Repository navigation
Conversation
…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]>
Contributor
Author
|
/ok to test ae7b38e |
…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]>
Contributor
Author
|
/ok to test edfdddf |
…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]>
yaoyu-33
added a commit
that referenced
this pull request
Nov 9, 2026
…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]>
Contributor
Author
|
/ok to test 2d0abfd |
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]>
Contributor
Author
|
/ok to test 03c9886 |
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]>
Contributor
Author
|
/ok to test 81bdb92 |
khazic
pushed a commit
to khazic/Gym-lao
that referenced
this pull request
Nov 24, 2026
…ode configs to claude_code_agent and deprecate harness_agent (NVIDIA-NeMo#5821) * feat(job_bench): serve typed resources sessions that lend the task sandbox 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]> * feat(job_bench): run the Codex, Hermes and Pi configs through single_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]> * feat(workspace_bench): serve typed resources sessions that lend the task 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]> * feat(workspace_bench): run the Codex, Hermes and Pi configs through single_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]> * feat(job_bench,workspace_bench): run the Claude Code configs through 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]> * chore(harness_agent): deprecate the agent 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 NVIDIA-NeMo#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]> * fix(workspace_bench): grade the files the agent left, keep frozen inputs 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]> * fix(job_bench): grade the output the agent left, and stop agent-run sandboxes 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]> * fix(harness_agent): reach the model server from the Claude Code sandboxes, 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]> * fix(job_bench): give the session configs an episode deadline that covers 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]> * fix(workspace_bench): give the session configs an episode deadline that 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]> * fix(job_bench,workspace_bench): give the Claude Code configs the deadlines of the other harnesses The Claude Code configs kept the 9000 s and 10200 s episode deadlines that NVIDIA-NeMo#5816 and NVIDIA-NeMo#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]> * docs(harness_agent): name what still blocks removing the agent 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]> * docs(harness_agent): say where the shared sandbox handling lives on the 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]> --------- Signed-off-by: yaoyu-33 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
workspace_benchcould only be run by an agent's own/run(harness_agentbehind alegacy_agentrelay): its seed took the flat row, kept the task sandbox and the frozen input files under the cookie, and only/verifyreleased them. An Environment Server could not seed it, hand the sandbox to a session agent, or close it.This PR makes Workspace-Bench a resources server that pairs with any session harness, in two commits:
resources_servers/workspace_bench/app.py).WorkspaceBenchResourcesServersubclassesSandboxSessionResourcesServerfromresources_servers/swebench/sandbox_sessions.py, the baseswebench,swe_gymandr2e_gymuse./seed_session(ResourcesSeedSessionRequest) starts the task sandbox with the inputs in/workspace/input, freezes a copy of them on the server as before, and lends the sandbox throughsandbox_accesswith theoperatescope and workdir/workspace. A repeated seed for the same episode returns the same sandbox. A task withoutmetadata.jsongets 422 before any sandbox starts./verifycaptures the sandbox'sinputandoutputtogether with the frozen inputs, stops the sandbox, drops the frozen copy, and judges. An identical retry gets the saved verdict back, or a new judgment of the same capture when judging did not finish (for example the judge sandbox failed), still against the inputs frozen at seed. A verify after close or expiry is masked withlost_session_verification. A failed collection stops the sandbox and raises./close_sessionstops the sandbox if verify did not, drops the frozen inputs, fences late seeds (409), and raises on a failed stop, keeping the sandbox for the retried close. Never-closed sessions expire with the sandbox'sttl_s; shutdown stops what is left and removes every frozen copy.harness_agent's cookie seed is unchanged: it returns the full sandbox descriptor, a repeat still gets 409, and its verify stops the sandbox.artifact_idreplay is unchanged.benchmarks/workspace_bench/{codex,hermes,pi}.yaml).harness_agentbehindlegacy_agentis replaced bycodex_agent,hermes_agentandpi_agentundersingle_agent_turn_legacy(the rows are flat). The harness settings carry over: system prompt, model, version pins, turn and token limits, the 2-hour agent budget (Hermes getssandbox_runner_timeout_seconds: 7200for it) and concurrency 32 (max_concurrent_episodes: 32). The episode deadline (18000 s) covers sandbox start, agent CLI setup, the agent's 2 hours, collection, a wait behind up to three judge runs (32 episodes sharenum_processes: 10judge slots), and the episode's own judge run. Verify starts well inside the session'sttl_s(10800 s); the task sandbox stops after collection and the judge has its own sandbox.allowed_agentsnow lists the three session agents.claude_code.yamlstays onharness_agentin this PR.Issue: none public; this PR is self-contained. #5816 does the same for
job_bench.Base class
This PR uses
SandboxSessionResourcesServerfromresources_servers/swebench/sandbox_sessions.py. When it opened, #5264 → #5267 proposed a second lending base. Both have since merged onto this same base (swebenchthrough itsCheckpointedSandboxSessionResourcesServersubclass), and every SWE resources server on main subclasses it, so Workspace-Bench is already on the standard base and has nothing left to move.Why the configs move to the session agents instead of staying on
harness_agent, which was built to keep sandbox handling in one place: see "Why retire it instead of extending it" in #5821. In short, the sandbox handling stays shared on this path, in the resources server base this PR adopts and in the environment server that orders the episode.Validation
Head 03c9886 merges
mainat f57d175. Run on a Linux workstation:pytest resources_servers/workspace_bench/testsin the server's own venv, built from itsuv.lock: 60 passed.pytest tests/unit_tests -n 16) on the chore(harness_agent): move the job_bench and workspace_bench Claude Code configs to claude_code_agent and deprecate harness_agent #5821 tree, which contains this branch: no failure that main lacks. 450 tests fail and 59 error on both this tree and main f57d175 in the same workstation venv, all inorchestration,sandbox,data,evaland other packages this PR does not touch.gym env validate --config benchmarks/workspace_bench/{codex,hermes,pi}.yaml: valid.pre-commit run --all-files: passed, no files changed.The earlier rounds' validation is in the review-fix sections below.
Rollout evidence
Real-model pairing runs on head 03c9886, one rollout per config, on a workstation:
benchmarks/workspace_bench/<harness>.yaml, with Docker's provider config in place of OpenSandbox's (host networking).nvidia/nemotron-3.5-super-vl-120b-a12bon a hosted NIM endpoint, thinking off.artifact_rootset, concurrency 1.WORKSPACE_BENCH_IMAGEwas built frompython:3.13-slimwith a stubagent_as_a_judge.py. The stub passes its one rubric whenoutput/holds a file and records the output and input file lists it received. The upstream judge needs its Node evaluation image and an Anthropic-compatible judge endpoint, and neither is available here.Each run logged seed_session →
/v1/agent_sessions→ model calls → the agent's turn →/v1/agent_sessions/close→ verify → close_session. Each started the task sandbox and a separate judge sandbox and left no container behind.codex.yamloutput/__PH_12__FixedAssetDepreciationLedger.mdhermes.yamloutput/Fixed_Asset_Depreciation_Ledger_PH_12_2024.txtpi.yamloutput/__PH_12__FixedAssetDepreciationLedger_2024.csvThese show the lifecycle and the hand-off to the judge, not scores. Each trial saved
input.tar.gz(the task's 5 input files, frozen at seed),workspace.tar.gzandmetadata.json, and the judge received the agent's output together with those 5 inputs. The Pi row was pending in the last round; these runs replace the ones at ae7b38e, which predate the review fixes.Review fixes (edfdddf)
/workspace/inputand/workspace/outputand accepts tar's exit 1, so files the agent removed or left changing are graded, not masked.KeyErroruntil close.metadata.jsonthat does not parse, or a manifest entry withoutstored_relpath/filename, gets 422 before any sandbox starts.harness_agentverify that fails while saving its artifacts stops the task sandbox. The cookie seed arm usesreject_partial_typed_seed.use_absolute_ip: true, Codexverify_after_agent_error/inherit_sandbox_environment, Pisandbox_bash_timeout_seconds: 7200, unused API-key keys dropped).pytest resources_servers/workspace_bench/tests60 passed (new tests fail on ae7b38e);gym env validateon all four configs;pre-commiton changed files clean.Compatibility
++...harness_agent.agent_kwargs.*overrides forcodex/pi/hermesno longer apply.harness_agentpath, a verify with no live sandbox is masked instead of HTTP 400; a task without a usablemetadata.jsongets 422 instead of 500; a concurrent repeat seed waits for the first, then gets 409.Review fixes, round 2 (2d0abfd)
codex/hermes/pi. 10200 s equalled task sandbox start (1200 s) + the agent's 7200 s + judge sandbox start (1200 s) +judge_timeout_s(600 s), with nothing left for agent CLI setup (up to 1200 s, outside the agent's timeout), collection, or a wait for a judge slot, so a slow grade timed out and reran the 2-hour episode. Raisingnum_processesto 32 instead would also have fit, but triples concurrent judge calls and with them the chance of rate-limited (masked) judge runs, so it stays 10.tests/unit_tests/sandbox/test_local_provider.py::test_supervisor_deadline_finishes_before_provider_hard_timeout[False](exit 143 vs SIGKILL, a timing race), is innemo_gym/sandbox, which this PR does not touch; the rerun of the failed jobs on the same SHA passed.gym env validateon all four configs;pytestjob_bench, workspace_bench, harness_agent, harness_exa_search andtest_session_contract_repoon the merged chore(harness_agent): move the job_bench and workspace_bench Claude Code configs to claude_code_agent and deprecate harness_agent #5821 tree: 186 passed;pre-commiton changed files clean.Main merge (03c9886)
mainat f57d175 (421 commits since this branch's base). One conflict, inresources_servers/workspace_bench/app.py: main (refactor(sessions): raise the session conflict errors for every 409 refusal #5691) changed the agent-run seed's plain 409 toResourcesSessionConflictError, which this branch'sseed_sessionalready raises. The resolution keeps this branch's side, soapp.pyis unchanged from 2d0abfd.pi.yamlkeepspi_version: 0.80.2, which is main'spi_agentpin (responses_api_agents/pi_agent/configs/pi_agent.yaml). feat(pi): upgrade the coding agent to 1.5.2 #6454 moves that pin to 1.5.2 and also edits this file's oldharness_agentblock (0.80.2 → 1.5.2). Whichever of the two merges second sets 1.5.2 in thepi_agentblock.🤖 Generated with Claude Code