Repository navigation
Description
Describe the bug
Terminal-Bench 4 can receive a successful HTTP response whose Responses payload is status=incomplete, incomplete_details.reason=max_output_tokens, and reasoning only. It has no message or tool call the agent can use. The agent may recover on a later call, but the clipped call remains part of the recorded trajectory.
At Gym commit f10d52fb18f22fcdf16260a3302267387e2b6f5f, model_call_runaway_generation reports a length-limited call only when _response_has_content(response) is false. That helper treats any nonempty output list as content, including a reasoning item without user-visible text or a tool call. A reasoning-only clipped response therefore produces no finding. The run quality summary can report a healthy rollout and zero runaway-generation findings, leaving a certificate reviewer no summary signal to inspect the capture.
In one completed 66-input TB4 evaluation, a middle call returned HTTP 200 with incomplete/max_output_tokens: 26,466 input and 1,022,110 reasoning output tokens exactly filled a 1,048,576-token window. It had empty output_text, no message or function call, and the agent recovered on the next call. The task's final health verdict was healthy and model_call_runaway_generation=0. This is a capture/health visibility gap; the original score and later recovery are not disputed.
Steps/Code to reproduce
-
On the cited Gym revision, give
_model_call_runaway_generationa matched call withfinish_reason="max_output_tokens"and this response shape:{ "status": "incomplete", "incomplete_details": {"reason": "max_output_tokens"}, "output_text": "", "output": [{"type": "reasoning", "summary": [{"type": "summary_text", "text": "partial reasoning"}]}], } -
Observe no
model_call_runaway_generationfinding, although the call is incomplete and contains no usable assistant message or tool invocation. Removing the reasoning item makes the check fire.
The relevant code is the length check and content helper. The Terminus 2 agent rejects incomplete_details and can recover, so final rollout success does not prove the earlier call was complete.
Expected behavior
- Surface an explicit captured-call length-limit finding/count when a response is incomplete at
max_output_tokensand has no usable message or tool call, even if it contains reasoning and a later call succeeds. - Preserve the recorded reward and the agent's recovery. The choice to mark the whole rollout unhealthy versus to add a separate recovered-clipping counter should be explicit; the clipped call must not disappear from run-level quality evidence.
- Keep legitimate completed reasoning output and context-overflow rejections distinct. Add a regression for the reasoning-only incomplete shape and for a subsequent successful call.
Configs and environment
Observed with the Gym Terminal-Bench 4 mini-SWE agent and a 1M-context model server. The minimal health-check reproduction does not require a cluster or private benchmark data. The private evaluation logs are not attached to this public issue.
Activity
fix(health): flag a length-limited call that gave the agent nothing t…
fix(health): do not flag a context overflow after an answer, and flag…