fix(scripts): use call curl in run.bat so batch control returns after download#131
Merged
fix(scripts): use call curl in run.bat so batch control returns after download#131
Conversation
… download CMD batch files silently swallow control when a .bat file is invoked without `call` — the called .bat runs, but execution never returns to the caller. The Windows CI test stubs real curl with a curl.bat shim (so it can intercept -o and plant the mock binary). Without `call`, run.bat exited immediately after the stub ran and never reached the `%BINARY% %*` line, producing empty stdout and a failing MCP handshake assertion. Using `call curl` is safe for real curl.exe (no-op for executables) and required for any .bat/.cmd on the PATH. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
CMD batch files silently swallow control when one
.batfile invokes another withoutcall— the called batch runs, but execution never returns to the caller.The Windows CI test (
test_run_windows.ps1) stubs realcurlwith acurl.batshim placed at the front ofPATH. Whenrun.batreaches the download step and invokes:curl -sfL ... -o "%BINARY%"CMD finds
curl.batfirst. Withoutcall, control transfers tocurl.bat, the fake download completes (copying the mock binary into place), butrun.batnever resumes —"%BINARY%" %*is never executed, stdout is empty, and the MCP handshake assertion fails.Fix
Add
callbefore all threecurlinvocations inrun.bat.callis a no-op for real.exefiles, so production behaviour is unchanged. For.bat/.cmdfiles onPATH, it ensures the caller gets control back.Test plan
Windows launcher MCP handshake (run.bat stdio)should now passcall curl.exeworks identically tocurl.exefor the real binary🤖 Generated with Claude Code