Skip to content

fix(anyswe_agent): keep rollout path on relay URLs, grade failed runs - #5060

Merged
cmunley1 merged 1 commit into
mainfrom
cmunley1/anyswe-observability
Oct 29, 2026
Merged

cmunley1 merged 1 commit into
mainfrom
cmunley1/anyswe-observability

Conversation

@cmunley1

Copy link
Copy Markdown
Contributor

What does this PR do?

Two small anyswe_agent fixes found while running NeMo Fabric harnesses on SWE-bench Verified through OpenSandbox.

  1. Keep the rollout path on sandbox_model_base_url. The relay URL reaches the same Gym model server, so it now keeps /ng-rollout/<id> like the default URL does. Without it, ++observability_enabled=true capture (and token capture) cannot attribute in-box model calls to a rollout whenever a run uses a relay, which is the usual OpenSandbox setup. harness_agent already keeps the prefix on its explicit override.
  2. Grade the patch when the harness raises. agent_runner.py now writes patch.diff in a finally block. Before, a harness that stopped on an error (a turn limit, a Fabric stop timeout) left no patch, so the rollout scored 0 without grading its edits. The existing mask rule (resolved after max_iteration or context_window) now applies to these rollouts as intended.

Validation

  • pytest responses_api_agents/anyswe_agent/tests: 70 passed. Both new tests fail on main.
  • ruff format and ruff check on the changed files: passed.

Rollouts

SWE-bench Verified on OpenSandbox through nemo_fabric_agent, self-hosted DeepSeek-V4.1-Flash policy reached through a relay, with ++observability_enabled=true ++model_call_capture_dir=.... With change 1, 8 rollouts across pi, OpenClaw, Kilo, Hermes and Deep Agents captured 11 to 40 model calls each (184 total), one capture file per rollout.

Compatibility and benchmark impact

  • A sandbox_model_base_url must now 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, so point it at the model server instead.
  • Rollouts whose harness raises after editing are now graded on those edits instead of scoring 0. Successful rollouts are unchanged.
  • anyterminal_agent has the same relay skip and is left for a follow-up.

Checklist

  • I have read the contributing guidelines.
  • The change is focused.
  • Tests added and pass locally.
  • Documentation: N/A, internal URL and patch 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.

…rade the patch when the harness raises

A sandbox_model_base_url relays to the same Gym model server, so it now keeps the
/ng-rollout/<id> path. Without it, observability capture and token capture cannot
attribute in-box model calls when a run uses a relay (the usual OpenSandbox setup),
as harness_agent already does.

The runner now writes patch.diff in a finally block, so a harness that stops on an
error (a turn limit, a Fabric stop timeout) is graded on the edits it made. The
existing mask rule (resolved after max_iteration or context_window) then applies.

Signed-off-by: Christian Munley <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 25, 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 c90035d

@cmunley1

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Oct 25, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 25, 2026 02:14
@cmunley1 cmunley1 changed the title fix(anyswe_agent): keep the rollout path on a sandbox model URL and grade the patch when the harness raises fix(anyswe_agent): keep rollout path on relay URLs, grade failed runs Oct 25, 2026

@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

LGTM — no reliability concerns.

Reviewed all three changed files and traced relay URL routing, partial-patch extraction, artifact retrieval, grading, and masking. No qualifying BLOCKER, RISK, or NOTE findings.

The delegated runner/test-isolation report was unavailable; that topic was independently checked against source. Static inspection only; tests and sandbox rollouts were not executed.

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.

eddy-nassif pushed a commit to youdotcom-oss/NeMo-Gym that referenced this pull request Oct 27, 2026
…VIDIA-NeMo#5111)

A sandbox_model_base_url relays to the same Gym model server, so it now keeps the
/ng-rollout/<id> path, as anyswe_agent (NVIDIA-NeMo#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]>
@cmunley1
cmunley1 merged commit c5a8619 into main Oct 29, 2026
50 of 53 checks passed
@cmunley1
cmunley1 deleted the cmunley1/anyswe-observability branch October 29, 2026 05:40

This branch was previously deployed

1 inactive deployment
public — c90035d1 Deployed Oct 25, 2026 by copy-pr-bot[bot] via release / finalize / notify #7140
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 needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants