Skip to content

fix(harness): survive binary tool output and slow container teardown - #6

Open
JeremyJC67 wants to merge 2 commits into
mainfrom
fix/binary-output-decode
Open

fix(harness): survive binary tool output and slow container teardown#6
JeremyJC67 wants to merge 2 commits into
mainfrom
fix/binary-output-decode

Conversation

@JeremyJC67

Copy link
Copy Markdown
Member

Two robustness fixes to the evaluation harness, both surfaced while running a full 3-run gpt-4o sweep of all 33 tasks.

Neither changes task content, verifiers, or scoring logic. Both turn a crash into a normal result, so they can only move numbers by letting tasks be scored that previously were not.

1. Strict UTF-8 decoding aborted tasks on binary tool output

_exec_in_container ran subprocess.run(..., text=True) with no errors= argument. Any command the agent issues that emits raw bytes — xxd -r -p, openssl raw output, binary tokens — raised UnicodeDecodeError, which propagated and killed the whole task run.

The task was then recorded as an error rather than scored, so it silently dropped out of the denominator instead of counting as a failure. Observed on oauth-authorization-code:

ERROR: 'utf-8' codec can't decode byte 0x98 in position 8: invalid start byte

Fixed by decoding with errors="replace", so the agent sees the output and the task is scored normally.

2. An uncaught teardown timeout aborted entire multi-run experiments

_stop_container ran docker stop with a 30-second timeout and let TimeoutExpired propagate. On a loaded host teardown can exceed that, and the uncaught exception killed a whole --k 3 experiment after its first task:

subprocess.TimeoutExpired: Command '['docker', 'stop', '0e52bc03d1c7...']' timed out after 30 seconds

Fixed by raising the timeout, falling back to docker rm -f, and swallowing teardown failures. Cleanup should never decide whether an experiment completes.

Verification

Before: a --k 3 sweep aborted after 1 task; a single-run sweep reported Summary: 11/33 passed, 1 errors.

After: Summary: 32/99 passed, 0 errors across the full 3-run sweep — 99 trials, zero harness errors.

HockJC added 2 commits September 2, 2026 21:57
_exec_in_container decoded docker exec output with strict UTF-8, so any
command emitting raw bytes (xxd -r -p, openssl, binary tokens) raised
UnicodeDecodeError and aborted the whole task run. The task was then
recorded as an error rather than scored, silently dropping it from the
denominator. Decode with errors=replace so the agent sees the output and
the task is scored normally.
_stop_container ran docker stop with a 30s timeout and let TimeoutExpired
propagate. On a loaded host teardown can exceed that, and the uncaught
exception killed an entire multi-run experiment after the first task.
Raise the timeout, fall back to docker rm -f, and swallow teardown
failures - cleanup must never decide whether the experiment completes.
Sign up for freeto 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

@JeremyJC67