Repository navigation
fix(harness): run the bash tool's command under bash - #78
Merged
Merged
Conversation
The command ran under each backend's `sh`, which is dash on Debian and Ubuntu, so bash syntax failed there. It was also pasted into the output wrapper, so a bash-only construct broke the wrapper's own parse. The wrapper now carries the command as a quoted string and runs it with `bash -c` when bash is on PATH, else `eval` under `sh`. The shell rides on the wrapper's report, and a failure under `sh` says so to the model. Co-Authored-By: Claude Opus 5.5 <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.
Problem
The
bashtool ran the model's command under each backend'ssh(host, Vercel, Daytona)./bin/shis dash on Debian and Ubuntu, so bash syntax (arrays,[[ ]],{1..3}, here-strings,source) worked on a Mac and failed on Linux.It was worse than a wrong shell: the command was pasted into the output wrapper, so under dash a bash-only construct broke the wrapper's own parse. The model got
sh: 3: Syntax errorpointing into our script, with no output file and no exit code.Fix
tool/output.ts: the wrapper carries the command as a quoted string and picks the shell inside the sandbox:eval, which needs no PATH lookup. There's noexec, because just-bash carries on past it.shends with(ran under sh: bash is not on PATH in this sandbox), so the model can fix the command and re-run. Successful runs are unchanged.Also updates the local sandbox doc and
CHANGELOG.md.Tests
tools.output.test.ts: bash-only syntax on host (streaming, re-encoded, buffered) and just-bash produces one artifact,__artifacts__/tools.bash.syntax.json. A syntax error staysBashFailedexit 2. A host without bash on PATH runs undershand states it on failure, for both the streaming and buffered paths.fixtures/bash.spec.ts: the same command on live Daytona and Vercel matches the same artifact (15/15 live bash tests pass)./bin/dash, the old code fails the three host cases; the new code passes all 48.gpt-6-luna(openai-codex and openai) andgemini-4-argon: every run answered correctly. Whereshis dash and bash is on PATH, the fix took 1 tool call instead of 2. Without bash, it took 2 calls instead of 2 to 4.vp checkandvp run typecheckare clean.🤖 Generated with Claude Code