Repository navigation
Conversation
…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]>
Contributor
Author
|
/ok to test a97d809 |
…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]>
Contributor
Author
|
/ok to test a5347b7 |
…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]>
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 bc0f2db |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
Contributor
Author
|
/ok to test 5bc46d7 |
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]>
Contributor
Author
|
/ok to test 6defec5 |
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 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
job_benchcould only be run by an agent's own/run(harness_agentbehind alegacy_agentrelay): its seed took the flat row, kept the task sandbox under the cookie, and only/verifystopped it. An Environment Server could not seed it, hand the sandbox to a session agent, or close it, and a sandbox leaked until its TTL whenever verify never ran.This PR makes Job-Bench a resources server that pairs with any session harness, in two commits:
resources_servers/job_bench/app.py).JobBenchResourcesServersubclassesSandboxSessionResourcesServerfromresources_servers/swebench/sandbox_sessions.py, the baseswebench,swe_gymandr2e_gymuse./seed_session(ResourcesSeedSessionRequest) starts the task sandbox, unpacks the task folder into/workspace/task, and lends the sandbox throughsandbox_accesswith theoperatescope and workdir/workspace. A repeated seed for the same episode returns the same sandbox. An unusable task (noTASK_INSTRUCTIONS.txt, invalidtask_data) gets 422 before any sandbox starts./verifyarchives/workspace/outputonce, stops the sandbox, and grades the archive. An identical retry gets the saved verdict back, or a regrade of the saved archive when grading did not finish. A verify after close or expiry is masked withlost_session_verification, not scored 0. A failed output collection stops the sandbox and raises, so the episode is retried rather than scored./close_sessionstops the sandbox if verify did not, 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.harness_agent's cookie seed is unchanged: it still returns the full sandbox descriptor, and its verify still stops the sandbox.artifact_idreplay is unchanged.benchmarks/job_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 (11400 s) covers sandbox start, agent CLI setup, the agent's 2 hours, collection and one round of judging; verify starts well inside the session'sttl_s(10800 s), and the task sandbox stops after collection.allowed_agentsnow lists the three session agents.claude_code.yamlstays onharness_agentin this PR.Issue: none public; this PR is self-contained.
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 Job-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 5bc46d7 merges
mainat f57d175. Run on a Linux workstation:pytest resources_servers/job_bench/testsin the server's own venv, built from itsuv.lock: 55 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/job_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 5bc46d7, one rollout per config, on a workstation:
benchmarks/job_bench/<harness>.yaml, with Docker's provider config in place of OpenSandbox's (host networking). Imagepython:3.13-slim.nvidia/nemotron-3.5-super-vl-120b-a12bon a hosted NIM endpoint, thinking off.nvidia/nemotron-3.5-lightning-30b-a3bon the same endpoint, set throughJOB_BENCH_JUDGE_*withJOB_BENCH_JUDGE_MAX_COMPLETION_TOKENS=16384. The default Grok judge was not exercised (no xAI key here).artifact_rootset, concurrency 1.technical_writers/task1from the pinned snapshot.Each run logged seed_session →
/v1/agent_sessions→ model calls → the agent's turn →/v1/agent_sessions/close→ verify → close_session. Each started one task sandbox and left no container behind./workspace/outputcodex.yaml.mddeliverableshermes.yaml.mddeliverablespi.yaml.mddeliverablesAn earlier Codex run on the same head (227 s, reward 0.788, unmasked) had request logging off, so its log does not show the call order. The row above is the repeat with logging on.
These replace the runs at a97d809, which predate the review fixes and whose in-episode verify a rate-limited judge masked. The in-episode verify is now graded unmasked for all three harnesses.
Still pending (before this leaves draft): the interrupted-sandbox case, where the task sandbox is killed mid-turn, so the episode should fail instead of scoring a measured 0.
Review fixes (a5347b7)
/workspace/outputand accepts tar's exit 1, so output the agent removed or left changing is graded, not masked. Only a sandbox or archive failure fails verify.harness_agentverify that fails while saving its artifacts stops the task sandbox, as main did.reject_partial_typed_seed. Archive build, write and extraction run off the event loop.use_absolute_ip: true(the in-sandbox agent must reach the model server;harness_agentused to rewrite loopback). Codex setsverify_after_agent_error: trueandinherit_sandbox_environment: true, asharness_agentgraded after a CLI error and passed the image environment. Pi setssandbox_bash_timeout_seconds: 7200(no per-command limit before). Unusedopenai_api_key/api_keykeys dropped.pytest resources_servers/job_bench/tests55 passed (6 new tests fail on a97d809);gym env validateon all four configs;pre-commiton changed files clean.Compatibility
++...harness_agent.agent_kwargs.*overrides forcodex/pi/hermesno longer apply; the settings now live on the session agents.harness_agentpath, a verify with no live sandbox is masked instead of HTTP 400, and an invalid task folder gets 422 instead of 500.harness_agentruns; compare against a fresh baseline.Review fixes, round 2 (bc0f2db)
codex/hermes/pi. 9000 s left 1800 s around the agent's 7200 s, 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 2-hour episode. Verify still starts before the session'sttl_sends; the judge runs on the server host after the task sandbox stops.responses_api_agents/opencode_agenttest_mcp_staging_expiry_is_incomplete_and_next_activation_recovers(a 2 s timing assertion), is in code 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 (5bc46d7)
mainat f57d175 (421 commits since this branch's base). No conflicts. The Job-Bench tests pass unchanged on main's currentSandboxSessionResourcesServer.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