Repository navigation
fix(anyterminal_agent): keep the rollout path on a sandbox model URL - #5111
Conversation
A sandbox_model_base_url relays to the same Gym model server, so it now keeps the /ng-rollout/<id> path, as anyswe_agent (#5060) and harness_agent do. Without it, model-call capture and token capture cannot attribute in-box model calls to a rollout whenever a run uses a relay. The in-box runner accepts a relay URL with or without /v1, so a trailing /v1 is removed before the rollout path, as in harness_agent. With no model_server configured, nothing strips the path, so the URL is left unchanged, as in claude_code_agent. Signed-off-by: Christian Munley <[email protected]>
|
/ok to test ed59da1 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
RISK — Provide a representative anyterminal relay smoke rollout
The PR explicitly reports no Terminal-Bench rollout, relying on unit tests and sibling anyswe_agent rollouts. Repository guidance requires real model smoke rollouts and inspection of agent/verifier behavior for behavior-changing agent work. This URL-construction change affects configured relay runs, but the test fixture bypasses initialization and never exercises the actual sandbox, wrapped agent, relay, or verifier. The SWE evidence does not validate those anyterminal-specific boundaries. This is a required-validation gap, not a demonstrated runtime defect.
Correction and acceptance: Could you run one small real Terminal-Bench task through anyterminal_agent with sandbox_model_base_url supplied with /v1/, observability enabled, and token-ID capture enabled on a supporting backend? Attach the resolved configuration/command, task and rollout identity, trajectory, verifier outcome, and inspected capture results. Model requests should complete without path-related 404s; model-call records and token IDs should be nonempty and attributed to that rollout, with trace context retained. No source patch is indicated solely by this evidence gap.
Preservation: Retain the regression assertions that root, /v1, and /v1/ relay URLs yield the same rollout/trace URL, while model_server=None leaves the direct gateway unchanged. Also retain the existing assertions for training-token-capture and plain rollout prefixes.
Static inspection covered both changed files and the affected runner, wrapped-agent URL consumers, and receiving middleware. No source-level correctness defect was confirmed. Tests and rollouts were not executed; the acceptance checks above are proposed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40571626441 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40572063847 |
What does this PR do?
Keeps the
/ng-rollout/<id>path onanyterminal_agent's in-box model URL whensandbox_model_base_urlis set, as #5060 does foranyswe_agentandharness_agentalready does.The relay URL reaches the same Gym model server (the Terminal-Bench Science and Terminal-Bench 4 docs describe it as a proxy to Gym's model server). Without the path,
++observability_enabled=truemodel-call capture and token-ID capture cannot attribute in-box calls to a rollout whenever a run uses a relay, which is the usual OpenSandbox setup. The URL also keeps the training-token-capture suffix and the URL-carried trace context. The in-box runner accepts a relay URL with or without/v1and appends/v1itself, so a trailing/v1is removed before the rollout path, asharness_agentdoes. With nomodel_serverconfigured, nothing strips the path, so the URL is left unchanged, as inclaude_code_agent.Validation
pytest responses_api_agents/anyterminal_agent/tests: 92 passed.test_explicit_sandbox_model_url_is_never_decoratedbecomestest_sandbox_model_url_keeps_the_rollout_path, parametrized over a root,/v1and/v1/relay URL, and fails onmain.ruff format --checkandruff checkon the changed files: passed./v1got the rollout path after/v1, so every in-box call 404ed. That is fixed and tested here. Round 2 confirmed nothing. Its one nit, a prefix with no configured model server, is also guarded and tested.Rollouts
No Terminal-Bench rollout for this PR. The change is the URL construction #5060 changed for
anyswe_agent, where 8 SWE-bench Verified rollouts through a relay captured 11 to 40 model calls each.Compatibility and benchmark impact
sandbox_model_base_urlmust route/ng-rollout/...paths, which every relay to the Gym model server does. A URL that bypasses the Gym model server and goes straight to a backend would now get the prefix and fail.Checklist