Skip to content

chore(harness_agent): move the job_bench and workspace_bench Claude Code configs to claude_code_agent and deprecate harness_agent - #5821

Merged
yaoyu-33 merged 27 commits into
mainfrom
yuya/deprecate-harness-agent
Nov 24, 2026
Merged

yaoyu-33 merged 27 commits into
mainfrom
yuya/deprecate-harness-agent

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What and why

harness_agent wraps another agent's Python code and runs it inside a sandbox through its own /run, behind a legacy_agent relay. The harnesses it wraps now serve sandbox sessions themselves, so the plan is to move its configs onto those session agents under an Environment Server and retire it.

Stacked on #5816 (job_bench) and #5817 (workspace_bench). This branch merges both, so until they merge the diff also shows their commits. The commits that belong to this PR are these two, plus the fixes listed in the sections below:

  1. feat(job_bench,workspace_bench): run the Claude Code configs through single_agent_turn_legacy. benchmarks/{job_bench,workspace_bench}/claude_code.yaml move from harness_agent behind legacy_agent to claude_code_agent, which borrows the task sandbox the resources server lends. The settings carry over: model, API key, max_turns: 100, the 2-hour budget, bare: false, the 2.1.261 pin, the system prompt, and concurrency 32. Without bare, Claude Code still discovers the Workspace-Bench office skills that the seed links at /workspace/.claude/skills. With feat(job_bench): serve typed resources sessions and run Codex, Hermes and Pi through single_agent_turn_legacy #5816 and feat(workspace_bench): serve typed resources sessions and run Codex, Hermes and Pi through single_agent_turn_legacy #5817, no shipped job_bench or workspace_bench config uses harness_agent any more. Both servers list claude_code_agent in allowed_agents and keep harness_agent's /run seed for compatibility.
  2. chore(harness_agent): deprecate the agent. This follows chore(agent): deprecate the legacy /run path of *_sandboxed_agent harnesses #5222: one DEPRECATED warning per process at startup (none in uvicorn workers) and a README banner that names the replacements. No behavior change beyond the log line.

Issue: none public; this PR is self-contained.

Why retire it instead of extending it

harness_agent was written to keep sandbox handling in one server instead of in each harness adapter. That goal still holds. On the session path the shared parts live where the sandbox is owned and the episode is ordered:

harness_agent does not remove per-harness code. It resolves the same adapter classes (resolve_agent), uploads Gym's source into the sandbox, and runs the adapter's own /run there. So every task image needs python3 and Gym's dependencies, and each harness keeps a second run path beside its session path. That second path is the agent-owned run(), which AGENTS.md deprecates in favor of agent sessions. What still differs between adapters (how each installs its runtime, its seed checks, how it maps outcomes) is open harness-consistency work. harness_agent runs those same adapters, so it does not unify that either.

The banner in responses_api_agents/harness_agent/README.md now says where the shared sandbox handling lives.

Not removed yet

harness_agent stays in the tree, because these still use it:

  • benchmarks/swe_atlas_qa/*.yaml (14 configs) and resources_servers/swe_atlas_qa/configs/swe_atlas_qa.yaml. Every harness they run has a session agent on main that works in a sandbox the resources server lends. deepagents and mini_swe move to langchain_deepagents_agent and mini_swe_agent, which do not use the Fabric adapters, so their scores need a fresh baseline. The blocker is the resources server. Its seed starts the task sandbox but returns an untyped descriptor instead of sandbox_access, so it needs the typed seed that feat(job_bench): serve typed resources sessions and run Codex, Hermes and Pi through single_agent_turn_legacy #5816 and feat(workspace_bench): serve typed resources sessions and run Codex, Hermes and Pi through single_agent_turn_legacy #5817 give Job-Bench and Workspace-Bench. Its sandbox also allows egress only to the model host, so a harness that downloads its runtime at seed needs it preinstalled or uploaded.
  • resources_servers/rna_design/configs/rna_design.yaml and environments/rna_design/manifest.yaml. These run Claude Code with forward_mcp_tools. The resources server starts no sandbox; its tools run in a local worker that it serves over MCP. single_agent_turn grants that MCP server as a required tool, and claude_code_agent refuses required remote tools, so Claude Code has no session path here yet. Hermes, mini_swe_agent and Pi accept MCP grants, but moving to one of them changes the harness.
  • responses_api_agents/harness_exa_search. It imports resolve_agent and _FABRIC_ADAPTERS from this agent, but only for the table of adapter names; it starts and runs its own sandbox. DeepSearchQA and WideSearch reach harness_agent through it, and feat(tavily_search): add Exa as a search provider and move the DeepSearchQA and WideSearch session harnesses onto it #5827 moves those presets.

The earlier version of this section said cline, prime, simple_strands and deepagents had no session agent. That is no longer true on main: cline_agent, prime_agent, simple_strands_agent and langchain_deepagents_agent all serve sandbox sessions, so the banner and warning drop that claim (f033e5a).

Validation

Head 68f8fb6. It merges the refreshed #5816 (5bc46d7) and #5817 (03c9886), which bring in main at f57d175. Run on a Linux workstation:

  • In each server's own venv, built from its uv.lock: pytest responses_api_agents/harness_agent/tests 67 passed, resources_servers/job_bench/tests 55 passed, resources_servers/workspace_bench/tests 60 passed, and responses_api_agents/harness_exa_search/tests 7 passed (run in the harness_agent venv, since its own venv has no pytest).
  • Core unit suite (pytest tests/unit_tests -n 16): no failure that main lacks. 450 tests fail and 59 error on both this tree and main f57d175 in the same workstation venv, all in orchestration, sandbox, data, eval and other packages this PR does not touch.
  • gym env validate --config benchmarks/{job_bench,workspace_bench}/{claude_code,codex,hermes,pi}.yaml: all eight valid.
  • pre-commit run --all-files: passed, no files changed. It was rerun on the files of 68f8fb6.

The earlier rounds' validation is in the review-fix sections below.

Rollout evidence

Real-model pairing runs of the two Claude Code configs, one rollout each, on a workstation. They ran on this branch's code at f033e5a; 68f8fb6 changes only the README.

  • Configs. The shipped benchmarks/<benchmark>/claude_code.yaml, with Docker's provider config in place of OpenSandbox's (host networking).
  • Model. nvidia/nemotron-3.5-super-vl-120b-a12b on a hosted NIM endpoint, thinking off, reached through the Gym model server's /v1/messages.
  • Settings. Agent budget lowered to 1800 s, artifact_root set, concurrency 1.
  • Judges. Job-Bench used nvidia/nemotron-3.5-lightning-30b-a3b on the same endpoint through JOB_BENCH_JUDGE_*. Workspace-Bench used the stub judge image described in feat(workspace_bench): serve typed resources sessions and run Codex, Hermes and Pi through single_agent_turn_legacy #5817, so its row shows the lifecycle, not a score.

Each run logged seed_session → /v1/agent_sessions → /v1/messages calls → the agent's turn → /v1/agent_sessions/close → verify → close_session. Each left no container behind.

Config Wall Model calls Agent output Verify
job_bench/claude_code.yaml (task technical_writers/task1, image python:3.13-slim) 234 s 25 the four requested .md deliverables reward 0.727 (7/10 rubrics, 48/66), unmasked
workspace_bench/claude_code.yaml (task 175) 64 s 10 output/__ PH_12 __.csv and .xlsx stub judge in its own sandbox, 1.0, unmasked

Skills with bare: false. The stub image carries a probe skill at /opt/workspace-bench/agent-homes/claude/.claude/skills/office-probe, the path the Workspace-Bench seed links to /workspace/.claude/skills. In that image, with the same link and /workspace as the working directory, Claude Code 2.1.261's system/init event lists office-probe among its skills. With --bare it does not. The pairing run's final answer did not mention the skill, so the run itself shows only that the agent saw /workspace/.claude.

The Codex, Hermes and Pi pairings of the same servers ran on their refreshed heads; see #5816 and #5817.

Review fixes (cc70e57)

Review fixes, round 2 (db8b8fe)

Compatibility

  • ++...harness_agent.agent_kwargs.* overrides for the two Claude Code configs no longer apply; the settings now live on claude_code_agent.
  • Scores from these configs come from claude_code_agent, not harness_agent's wrapped run; compare against a fresh baseline.
  • Episode deadlines are 11400 s (job_bench) and 18000 s (workspace_bench).
  • harness_agent logs one DEPRECATED warning per process at startup; nothing else about it changes.

Main merge (68f8fb6)

🤖 Generated with Claude Code

yaoyu-33 and others added 7 commits November 8, 2026 08:55
…ndbox

JobBenchResourcesServer now subclasses SandboxSessionResourcesServer, so an
Environment Server can seed an episode session, hand the agent the task
sandbox through sandbox_access (operate scope, workdir /workspace), verify,
and close. Verify archives /workspace/output once, stops the sandbox, and
replays the first verdict to an identical retry; a verify after close is
masked. Close stops the sandbox if verify did not and fences late seeds; a
session that is never closed expires with the sandbox's ttl_s, and shutdown
stops what is left.

harness_agent's /run seed still returns the sandbox descriptor, and its
verify still stops the sandbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…agent_turn_legacy

benchmarks/job_bench/{codex,hermes,pi}.yaml drop harness_agent behind
legacy_agent. single_agent_turn_legacy now seeds the resources server, lends
its task sandbox to codex_agent, hermes_agent or pi_agent, closes the agent
before grading, and closes the resources session. The harness settings carry
over (system prompt, model, version pins, turn and token limits, 2-hour agent
budget, concurrency 32), and the episode deadline stays inside the sandbox's
ttl_s. claude_code.yaml stays on harness_agent for now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…ask sandbox

WorkspaceBenchResourcesServer now subclasses SandboxSessionResourcesServer, so
an Environment Server can seed an episode session, hand the agent the task
sandbox through sandbox_access (operate scope, workdir /workspace), verify,
and close. The inputs stay frozen on the server from seed: verify captures the
sandbox's input and output together with them, stops the sandbox, and judges;
an identical retry replays the verdict or rejudges the same capture. A verify
after close is masked. Close stops the sandbox if verify did not, drops the
frozen inputs and fences late seeds; expiry and shutdown stop what is left.

harness_agent's /run seed still returns the sandbox descriptor and still gets
409 on a repeat; its verify still stops the sandbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…ingle_agent_turn_legacy

benchmarks/workspace_bench/{codex,hermes,pi}.yaml drop harness_agent behind
legacy_agent. single_agent_turn_legacy now seeds the resources server, lends
its task sandbox to codex_agent, hermes_agent or pi_agent, closes the agent
before judging, and closes the resources session. The harness settings carry
over (system prompt, model, version pins, turn and token limits, 2-hour agent
budget, concurrency 32), and the episode deadline leaves room for a queued
judge run inside the sandbox's ttl_s. claude_code.yaml stays on harness_agent
for now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…single_agent_turn_legacy

benchmarks/{job_bench,workspace_bench}/claude_code.yaml drop harness_agent
behind legacy_agent for claude_code_agent, which borrows the task sandbox the
resources server lends. The Claude Code settings carry over (model, API key,
max_turns 100, the 2-hour budget, bare false, the 2.1.261 pin, the system
prompt, concurrency 32); without bare, Claude Code still discovers the
Workspace-Bench office skills linked into /workspace/.claude/skills. No
shipped job_bench or workspace_bench config uses harness_agent now; both
servers list claude_code_agent first in allowed_agents and keep
harness_agent's /run seed for compatibility.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
harness_agent runs each episode through its own legacy /run path behind a
legacy_agent relay. Its job_bench and workspace_bench configs now run on the
harnesses' own session agents, so the agent logs one DEPRECATED warning per
process at startup (not in uvicorn workers) and its README opens with a
deprecation banner, as #5222 did for the sandboxed agents. The warning names
the replacements and the configs that still use it (swe_atlas_qa, rna_design);
harness_exa_search still builds on its agent registry. No behavior change
beyond the log line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 8, 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.

@yaoyu-33

yaoyu-33 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 67e6d69

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior labels Nov 8, 2026
yaoyu-33 and others added 5 commits November 8, 2026 17:12
…uts with their sandbox, and own the judge sandbox

- Collection recreates /workspace/input and /workspace/output before archiving and accepts tar's exit 1
  (a file the agent's process changed mid-read), so folders the agent removed or left changing are graded
  instead of failing verify and masking the episode. Only a sandbox or archive failure fails the verify.
- The frozen inputs are dropped only when the task sandbox stops, so a collection whose stop also failed
  can be retried instead of failing with a KeyError until close.
- A harness_agent verify that fails while saving its inputs and request (artifact_root) now stops the task
  sandbox; an agent-run session gets no close, so it stayed up until shutdown.
- The judge sandbox is registered as the session's verifier sandbox and stopped through the base's
  shielded stop, so a cancelled verify still stops it and close or shutdown retries a failed stop.
- A metadata.json that does not parse or a manifest entry without stored_relpath/filename gets 422
  before any sandbox starts, instead of a retried 500.
- The cookie arm of /seed_session rejects a malformed typed seed (reject_partial_typed_seed).
- The capture is written to disk off the event loop.
- Tests: the archive fixture is built once, since gzip stamps the time into its header.
- Configs: use_absolute_ip: true, so the in-sandbox agent reaches the model server; Codex grades a run
  whose CLI exited with an error and inherits the image environment, as harness_agent did; Pi's
  per-command bash limit is the agent budget; unused API-key keys are dropped. READMEs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…andboxes on every verify failure

- Collection recreates /workspace/output before archiving and accepts tar's exit 1 (a file the agent's
  process changed mid-read), so an output folder the agent removed or left changing is graded instead of
  failing verify and masking the episode. Only a sandbox or archive failure fails the verify.
- A harness_agent verify that fails while saving its request and rubrics (artifact_root) now stops the
  task sandbox, as main did; an agent-run session gets no close, so it stayed up until shutdown.
- The cookie arm of /seed_session rejects a malformed typed seed (reject_partial_typed_seed) instead of
  starting an agent-run sandbox for it.
- The seed's task archive, the output archive write and its extraction run off the event loop.
- Configs: use_absolute_ip: true, so the in-sandbox agent reaches the model server; Codex grades a run
  whose CLI exited with an error and inherits the image environment, as harness_agent did; Pi's
  per-command bash limit is the agent budget; unused API-key keys are dropped.
- READMEs: the model-server address, Codex and Pi need egress, and the harness_agent path's changed
  answers (masked instead of 400, 422 instead of 500).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…harness-agent

Signed-off-by: yaoyu-33 <[email protected]>

# Conflicts:
#	benchmarks/job_bench/README.md
#	resources_servers/job_bench/README.md
…ecate-harness-agent

Signed-off-by: yaoyu-33 <[email protected]>

# Conflicts:
#	benchmarks/workspace_bench/README.md
#	resources_servers/workspace_bench/README.md
…oxes, and say which harnesses cannot move yet

- benchmarks/{job_bench,workspace_bench}/claude_code.yaml set use_absolute_ip: true, like their Codex, Hermes
  and Pi siblings: claude_code_agent hands the in-sandbox CLI the server address as configured, while
  harness_agent used to rewrite a loopback host to this host's address.
- The deprecation banner and warning name the harnesses with no session agent to move to (cline, prime,
  simple_strands, deepagents), so removal waits on them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test cc70e57

yaoyu-33 and others added 5 commits November 8, 2026 22:07
…ers a slow grade

The 9000 s deadline left 1800 s around the agent's 7200 s budget, but sandbox
start may take 1200 s, agent CLI setup up to 1200 s outside the agent's
timeout, and one round of rubric judging about 900 s, so a slow grade timed
out and reran the whole 2-hour episode. 11400 s covers the slowest scored
path. Verify still starts well before the session's ttl_s ends, the task
sandbox is stopped after output collection, and the judge runs on the
resources server host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…at covers a slow grade

The 10200 s deadline equals task sandbox start (1200 s), the agent's 7200 s,
judge sandbox start (1200 s) and the judge's 600 s, with nothing left for
agent CLI setup (up to 1200 s, outside the agent's timeout), collection, or a
wait for one of the server's 10 judge slots, which 32 concurrent episodes
share. A slow grade timed out and reran the whole 2-hour episode. 18000 s
covers the slowest scored path, including a wait behind three judge runs.
Verify still starts well before the session's ttl_s ends, the task sandbox is
stopped after collection, and the judge runs in a sandbox of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…lines of the other harnesses

The Claude Code configs kept the 9000 s and 10200 s episode deadlines that
#5816 and #5817 raised to 11400 s and 18000 s, so a slow grade timed out and
reran the 2-hour episode only for Claude Code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33 and others added 5 commits November 20, 2026 13:41
Main's conflict-error change (#5691) is already in this branch's seed_session, so the conflicts keep the branch side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…harness-agent

Brings in main. harness_agent keeps main's ResourcesCloseSessionRequest import (#5085) next to this branch's worker check for the deprecation warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…ecate-harness-agent

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Main now serves sandbox sessions with a lent sandbox in cline_agent, prime_agent, simple_strands_agent and
langchain_deepagents_agent, so the banner and warning no longer say those harnesses have nothing to move to.
What blocks swe_atlas_qa is its resources server, which does not lend its task sandbox; rna_design forwards
required MCP tools to Claude Code, which claude_code_agent does not accept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test f033e5a

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 20, 2026
…he session path

harness_agent was built to keep sandbox handling in one server. The banner now says where that handling lives
for the session agents that replace it: the resources server base that starts, lends and stops the task sandbox,
the environment server that orders the episode, and the launch and stop helpers in nemo_gym/agents/utils/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 68f8fb6

yaoyu-33 and others added 4 commits November 23, 2026 12:23
Keep this branch's benchmarks/job_bench/README.md. Main's note that the
harness_agent image needs the Hermes worker (#2052) does not apply here:
Hermes runs through hermes_agent on a lent sandbox and uploads its runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Keep this branch's benchmarks/workspace_bench/README.md. Main's note that
the harness_agent image needs the Hermes worker (#2052) does not apply here:
Hermes runs through hermes_agent on a lent sandbox and uploads its runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…harness-agent

That branch now carries main. Keep this branch's
benchmarks/workspace_bench/README.md: every harness, Hermes included, runs on
a lent sandbox here, so main's Hermes-worker note for harness_agent images
(#2052) does not apply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…ecate-harness-agent

That branch now carries main. Keep this branch's
benchmarks/workspace_bench/README.md, which moves Claude Code off
harness_agent as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 98b9e60

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 23, 2026 20:33
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Nov 23, 2026
@yaoyu-33
yaoyu-33 added this pull request to the merge queue Nov 24, 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/45304698900

Merged via the queue into main with commit 76b3155 Nov 24, 2026
69 of 71 checks passed
@yaoyu-33
yaoyu-33 deleted the yuya/deprecate-harness-agent branch November 24, 2026 01:39
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 feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants