Skip to content

fix(bench): use Bun-style spawnSync in command verify branches - #297

Merged
dahai80 merged 2 commits into
mainfrom
bench/harness-gain-run
Nov 20, 2026
Merged

dahai80 merged 2 commits into
mainfrom
bench/harness-gain-run

Conversation

@dahai80

@dahai80 dahai80 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Found during the first full 20-task suite run (post-merge acceptance of #291/#294): every task whose verifier is command-based crashed with TypeError: cmd must be an array after the agent had already run, discarding the result.

Root cause

command-exit, command-stdout and pytest branches in verify() call Bun.spawnSync with the Node child_process signature (cmd: string, args: string[], opts). Bun's API is (cmd: string[] | string, options) — the args array was interpreted as the options object.

Fix

  • command-exit / command-stdout: Bun.spawnSync(cmd.split(" "), { cwd })
  • pytest: Bun.spawnSync(["python3", "-m", "pytest", ...], { cwd })

Verification

Solo rerun of T06: previously crashed in <1s, now completes a real 108.8s agent run and emits a verify verdict (pytest exit=1, model genuinely failed the task — that part is measurement, not harness).

🤖 Generated with Claude Code

dahai80 and others added 2 commits November 20, 2026 21:39
command-exit, command-stdout and pytest verify branches called
Bun.spawnSync with the Node child_process signature
(cmd: string, args: string[], opts) which Bun does not support -
Bun.spawnSync takes (cmd: string[] | string, options). Every task
with a command-based verifier crashed with
'TypeError: cmd must be an array' after the agent ran, discarding
the run result.

Switch all three branches to Bun.spawnSync(cmdArray, { cwd }).
Verified solo: T06 now completes with a real 108.8s agent run and
produces a verify verdict instead of throwing.

Co-Authored-By: Claude Code <[email protected]>
The T10 fixture build.sh ended with 'exit 0\r'. Under CRLF bash
still exits 0 (shebang is ignored when invoked as 'bash build.sh',
'set -e\r' errors out without enabling errexit, and 'exit 0\r' is
accepted) - so the untouched broken fixture passed the verifier and
a dead agent run was scored resolved=true (observed in run
2026-11-20T14-04-38-143Z, T10 resolved=true wall=0.4s).

New fixture drops the trailing exit line so the script's exit code
is the last command's status: 'test -f src/main.py\r' fails under
CRLF (exit 1) and passes after a real line-ending fix (exit 0).
Verified both paths in a sandbox before commit.

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit a0bf3c5 into main Nov 20, 2026
1 check passed
@dahai80 dahai80 mentioned this pull request Nov 20, 2026
dahai80 added a commit that referenced this pull request Nov 21, 2026
Valid run 2026-11-21T02-52-26Z (fixed harness: #297 verifier fix,
permission bypass, tool-call-as-text recovery loop): 3/20 (15%), all
easy tasks, no timeouts, textEmissions 0. Conclusions: harness fixes
worth 0->3; 8B ceiling is the easy/medium boundary; opencode/goose
pending for cross-harness comparison.

Co-Authored-By: Claude Code <[email protected]>
dahai80 added a commit that referenced this pull request Nov 21, 2026
T13's fixture contains an unfixed infinite-retry loop; pytest on the
untouched file hangs forever (verified: killed by SIGKILL at the 60s
cap). A verifier must fail, never hang, on an untouched fixture — same
principle as the CRLF trap fixed in #297. Applies a 60s timeout to the
pytest / command-exit / command-stdout verifiers; timeout counts as
unresolved.

Found when the opencode suite wedged 4h on T13 (its agent's edit was
permission-rejected, leaving the fixture unfixed).

Co-Authored-By: Claude Code <[email protected]>
dahai80 added a commit that referenced this pull request Nov 21, 2026
Valid run 2026-11-21T02-52-26Z (fixed harness: #297 verifier fix,
permission bypass, tool-call-as-text recovery loop): 3/20 (15%), all
easy tasks, no timeouts, textEmissions 0. Conclusions: harness fixes
worth 0->3; 8B ceiling is the easy/medium boundary; opencode/goose
pending for cross-harness comparison.

Co-Authored-By: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant