Skip to content

fix(anyterminal_agent): keep the rollout path on a sandbox model URL - #5111

Merged
cmunley1 merged 1 commit into
mainfrom
cmunley1/anyterminal-relay-rollout-path
Oct 27, 2026
Merged

cmunley1 merged 1 commit into
mainfrom
cmunley1/anyterminal-relay-rollout-path

Conversation

@cmunley1

Copy link
Copy Markdown
Contributor

What does this PR do?

Keeps the /ng-rollout/<id> path on anyterminal_agent's in-box model URL when sandbox_model_base_url is set, as #5060 does for anyswe_agent and harness_agent already 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=true model-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 /v1 and appends /v1 itself, so a trailing /v1 is removed before the rollout path, as harness_agent does. With no model_server configured, nothing strips the path, so the URL is left unchanged, as in claude_code_agent.

Validation

  • pytest responses_api_agents/anyterminal_agent/tests: 92 passed. test_explicit_sandbox_model_url_is_never_decorated becomes test_sandbox_model_url_keeps_the_rollout_path, parametrized over a root, /v1 and /v1/ relay URL, and fails on main.
  • ruff format --check and ruff check on the changed files: passed.
  • Local review with three independent reviewers and per-finding verification, two rounds. Round 1 confirmed that a relay URL ending in /v1 got 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

  • A sandbox_model_base_url must 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.
  • Scores are unchanged. Only the model URL path seen by the harness changes.

Checklist

  • I have read the contributing guidelines.
  • The change is focused.
  • Tests added and pass locally.
  • Documentation: N/A, internal URL handling.
  • Pre-commit checks pass locally.
  • New source files include the required Apache-2.0 SPDX header (no new files).
  • All commits have DCO sign-off.

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]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cmunley1

Copy link
Copy Markdown
Contributor Author

/ok to test ed59da1

@cmunley1

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working waiting-on-customer Waiting on the original author to respond labels Oct 27, 2026
@cmunley1
cmunley1 added this pull request to the merge queue Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40571626441

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40572063847

Merged via the queue into main with commit 48a58f5 Oct 27, 2026
70 of 78 checks passed
@cmunley1
cmunley1 deleted the cmunley1/anyterminal-relay-rollout-path branch October 27, 2026 20:19

This branch was previously deployed

1 inactive deployment
public — ed59da1f Deployed Oct 27, 2026 by copy-pr-bot[bot] via release / finalize / notify #7524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants