Repository navigation
fix(stirrup): report a run that exhausts its turns as stop_reason max_turns - #5937
Conversation
…_turns A Stirrup run that used every turn without a finish call answered status incomplete with no stop_reason, so it could not be told apart from other incomplete responses in the rollout data. Record stop_reason max_turns, the same way a wall-time stop records wall_time. The response stays incomplete and is graded as before. Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 0ecbd49 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I reviewed all four changed files and traced max_turns through response metadata, observations, and grading. The guard preserves existing stop reasons and the incomplete status. The updated tests assert both runner and session behavior.
Static review only; I didn't run tests or CI. Stirrup's external loop source isn't included, so I couldn't independently verify all of its return paths.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
mpatel31415
left a comment
There was a problem hiding this comment.
Reviewed the full diff and Stirrup 0.1.12 return paths. The new reason applies only to a return without finish parameters or an existing stop reason; cancellation, model failure and unusable compaction summaries retain their reasons and status/grading behavior. Independently ran the exact-head component suite: 170 passed; nine session-supervisor cases fail on macOS because /proc/uptime is absent, before reaching their assertions. A representative affected session case fails identically on parent 3783d71. The changed direct-runner max-turns regression passes; required Linux CI is green. Metadata-only change; new model rollout evidence is not applicable. No findings.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42896895542 |
Merge main at 330c461 into the agentic CritPt branch. Where main has since added its own handling for something this branch also changed, the merge keeps main's version: - responses_api_models/vllm_model is identical to main. The exact completion fitting is dropped; main's refit_output_budget_to_prompt (NVIDIA-NeMo#5864) covers what the agentic recipe needs. - Stirrup compaction failure uses main's handling (NVIDIA-NeMo#5822) and its max_turns stop reason (NVIDIA-NeMo#5937). In finish_tool mode the grader scores an agent_invalid_output response zero as candidate_no_answer. - Context-overflow recovery becomes the opt-in Stirrup option context_overflow_recovery (default false). The runner reports the model server's own rejection. - The grader's execution sessions use ResourcesSessionLocks and ResourcesSessionFences (NVIDIA-NeMo#5083); agentic_execution refuses several workers (NVIDIA-NeMo#4790). - A semantic validator failure or timeout stays unscorable with score_comparator_uncertain_as_incorrect (NVIDIA-NeMo#5416). - nemo_gym/ is unchanged. Two fixes found while validating the merge: - Since NVIDIA-NeMo#5128 the single_agent_turn environment servers and the agents that verify through verify_agent_response send failure_report with every /verify request. The grader read it as an unknown task field and answered task_invalid for every such rollout; it is now a framework field. - tests/test_runner_remote.py built ExecutionPolicy with four arguments the policy does not have and expected a 2 GiB address-space limit it never set, so nine of its tests failed; both are corrected. Also included: fixes from a review of the merged diff (session glossary wording, main's lost-session body on /code_exec, tighter execution limits, a stopped session releasing its capacity slot, route tests, and a local end-to-end grade of a semantic-validator task). Signed-off-by: Erik Arakelyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-python-host-adapters Resolve the Stirrup conflicts: keep the ladder's metadata (an optional elapsed_seconds and stop_reason) and add the agent_timeout_sec key and resolve_agent_timeout from the base. The base now carries #5937, whose runner reports stop_reason="max_turns" when Stirrup runs out of turns. Read the turn limit from that stop reason instead of from an incomplete run without one, so such a run stays incomplete (agent_limit) instead of failing as agent_run_error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
What does this PR do?
A Stirrup run that uses all of
agent_max_turnswithout calling a finish tool answersstatus: incompletewith nostop_reason. In the rollout data it looks the same as any other incomplete response, so a turn-capped row cannot be told apart from an unexplained one when reading a run.The sandbox runner now records
stop_reason: max_turnsin that case, the same way a wall-time stop recordswall_time. Stirrup'srun()only returns without finish params when the turn budget is spent (cancellation, model rejection and compaction failure already set their own reasons), so the label is unambiguous. The response staysincompleteand is verified and graded exactly as before.Validation
pytest responses_api_agents/stirrup_agent/tests: 179 passed.test_sandbox_runner.py,test_sessions.py) fail; with it they pass.ruff checkandruff format --checkonresponses_api_agents/stirrup_agent: clean.Rollouts
N/A for new rollouts: the change adds one metadata field and does not change the status, output items or grading. The tests drive the real Stirrup loop against a fake model server until it runs out of turns.
Compatibility and benchmark impact
None for scores. Responses of turn-capped runs gain
metadata.stop_reason: max_turns; consumers that only readstatussee no difference.Checklist
agent_max_turns.)pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).