Repository navigation
fix(terminal_bench_4): report deadline-ended runs and verifier timeouts accurately - #4230
Draft
giuliolovisotto wants to merge 1 commit into
Draft
giuliolovisotto wants to merge 1 commit into
giuliolovisotto wants to merge 1 commit into
Conversation
… timeouts accurately The agent server relabelled a run that reached its deadline as a timeout only after the harness had built its observations, so a command the sandbox ended at the deadline could emit an invocation with status "failed" next to a "timeout" termination. The harness now applies the deadline itself before deriving observations, and reports a timed-out invocation as "incomplete" with error_type "TimeoutError", matching Terminus 2. The TB4 resources server kept only the first exception, so a verifier timeout after an agent timeout was reported as AgentTimeoutError. The verifier's exception is now also recorded as verifier_exception_info and is what the verify response reports when there is no reward. exception_info is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Giulio Lovisotto <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This branch has not been deployed
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.
What does this PR do?
Fixes two reporting bugs in the TerminalBench-4 path (the
miniswe_sandboxed_agentharness and theterminal_bench_4resources server). Rewards, scores and verification flow are unchanged; only status and failure labels change.1. A run that ended at its deadline could say
failed. The agent server relabelled a deadline-ended run astermination.reason="timeout"only afterMiniSWEHarness.executereturned. By then the harness had already built the rollout observations from the earlier reason. When the sandbox ends the command at the deadline and reports a non-zero exit instead of raising, the harness seesinfrastructure_error. The result was an invocation withstatus="failed"next to atimeouttermination.AgentInvocation.error_typewas also never set.MiniSWEHarness.executenow applies the deadline check itself (deadline = start + budget), before it derives observations. The invocation status, the tool-call statuses and thenative_trajectory_partialgap now all agree with thetimeouttermination. The check inapp.pywas removed because it only duplicated this one.status="incomplete"witherror_type="TimeoutError". This matches how Terminus 2 reports a time-limited run.2. A verifier timeout was hidden by an earlier agent timeout.
lifecycle.exceptionrecordedexception_infowithsetdefault, so only the first exception was kept. If the agent timed out (AgentTimeoutError) and the verifier then also timed out (VerifierTimeoutError), the verify response saidinfrastructure_error="AgentTimeoutError". The real reason there was no reward was lost.result["verifier_exception_info"].exception_infostill holds the agent's exception._verified_responsereports the verifier's exception first and falls back toexception_infoas before.infrastructure_errorandfailure_reasontherefore sayVerifierTimeoutError.Related: #2831, #3182.
Validation
pytestinresponses_api_agents/miniswe_sandboxed_agent(environment built bygym env test +entrypoint=responses_api_agents/miniswe_sandboxed_agent): 125 passed, 1 skipped, and 1 timing failure intest_runner_stops_before_verification_and_retains_partial_trajectory[cancel], which passed on two reruns. The machine was heavily loaded by other test runs. The 77 tests intest_server.py,test_agent_server.pyand the new worker test passed.pytestinresources_servers/terminal_bench_4(environment built bygym env test +entrypoint=resources_servers/terminal_bench_4): 114 passed.test_environment.py::test_offline_policy_and_unsupported_configfails onmaintoo whenOPENSANDBOX_*_CPUvariables are set in the shell, so they were unset for this run.'infrastructure_error'instead of'timeout', and the failure is'AgentTimeoutError'instead of'VerifierTimeoutError'.pre-commit run --files <changed files>: passed.New regression tests:
responses_api_agents/miniswe_sandboxed_agent/tests/test_worker.py::test_command_ended_at_deadline_is_an_incomplete_timeout: the sandbox ends the runner at the deadline and returns exit 137 instead of raising. The test expectstermination.reason == "timeout", invocationstatus == "incomplete"anderror_type == "TimeoutError". Onmainthis run comes back asinfrastructure_error/failed.responses_api_agents/miniswe_sandboxed_agent/tests/test_server.py::test_verifier_timeout_after_agent_timeout_reports_the_verifier: an agent timeout followed by a verifier timeout. The test expects the response to reportVerifierTimeoutError, with the agent'sAgentTimeoutErrorstill inexception_info. This test drives the real TB4 resources server and lifecycle.Rollouts
N/A. The change touches only status and failure labels in the emitted records. Agent behaviour, the verifier and rewards are unchanged, and the regression tests cover both paths deterministically.
Compatibility and benchmark impact
status="incomplete"anderror_type="TimeoutError". Before, they could befailedwith noerror_type.infrastructure_error/failure_reason. Before, they reportedAgentTimeoutError.verifier_exception_infokey. Readers that use.getare unaffected.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code