Repository navigation
feat(officeenv): run OfficeEnv episodes in a sandbox, for Gym's sandboxed harnesses - #5010
Conversation
64c29c9 to
7f3b747
Compare
|
Review of 20676db. Each item has a failing test I can share. 1. A provider failure reading an attachment reaches the model as a missing file (app.py L1453-L1458) 2. 3. (nit) 4. (nit) |
20676db to
af279fe
Compare
6f6ae28 to
6ea2e28
Compare
6ea2e28 to
199654c
Compare
|
Thanks for the review. All four are fixed on the new head ( 1. Provider failure scored as a missing attachment (
2.
3.
4.
Since your review: episodes waiting with a sandbox lent ( A training run with Pi on an OpenSandbox cell found another lifetime gap:
If your failing tests differ from the ones added here, I'd be glad to run them against the new head. |
f492d3a to
e0f9d7a
Compare
|
Two commits since my reply above, both on the shutdown path from your item 3:
|
e117d54 to
242eff5
Compare
242eff5 to
12836ab
Compare
12836ab to
ea9cfe3
Compare
…mpleted A stop with completed: true, for a run whose task ended, makes the run's response completed (report_rollout_stop), but the harness agents record their invocation before that, as incomplete. So the same run had two statuses: completed in its response and incomplete in its agent observations (for Prime, and for every agent in ROLLOUT_STOP_AGENT_TYPES). The base agent's session close now applies report_completed_rollout_stop when the rollout's sandbox session ended with a completed stop: each top-level invocation the stop left incomplete says completed, with no error type. The sandbox observation keeps the supervisor's raw timeout, and a child invocation keeps its own status. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
… closes completed The integration guide says that simple_agent runs a caller-driven step once without checkpointing, and that the session close of a run stopped as completed reports its top-level invocation as completed. The harness guide says the same of the close. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
The close now clears the step the session kept for a step sent again, so a session never keeps it after it ends. The docstring says why only caller-driven steps without checkpointing need it: with checkpointing, the activation tracking already gives a repeated activation its saved reply, and any other activation is the episode's only one or a continuation session's turn on new input. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
…n completed A second agent from ROLLOUT_STOP_AGENT_TYPES, besides Prime, whose close after a completed stop has the shape the base close fixes: a top-level invocation left incomplete, which report_completed_rollout_stop marks completed, and a sandbox observation that keeps the supervisor's timeout. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Brings in main's dependency bump (#6268: hydra-core, omegaconf, mlflow, gitpython), so the stacked #5010 can build its new officeenv_sandbox lock against the same base CI tests. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test a8011c3 |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
CI tests this branch merged onto #6162's merge ref with main. Main's #6268 bumped hydra-core (>=1.4.0rc3), omegaconf (>=2.4.1rc2), mlflow and gitpython in the root pyproject, which this server's lock includes through nemo-gym. So `uv sync --locked` and the lock check refused this lock in CI. This lock was made with `uv lock` on a tree shaped like CI's: this branch merged onto #6162's merge ref 5c7691f (942c31a on main 6aa1fd6). There, `uv lock --check` and `uv sync --locked` pass, and the server's tests pass. On this branch alone, `uv lock --check` fails until #6162 contains main, because the branch still has the older root pyproject. The lock is the one that is right once #6162 has main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 7bfc249 |
…tion Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 204834a |
@yfw, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 204834a |
|
@yaoyu-33 Thanks for the review. Each point of your HOLD has a fix on the branch, with a test that fails without it.
The mini-SWE config is no longer in this PR ( The current head is |
Signed-off-by: yaoyu-33 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
|
I’ll update the mixed OfficeEnv preset so both sets of sandboxless services stay on loopback, then check the resolved Docker and OpenSandbox configs and their row routing. I’ll also sync the reviewed task-end fix from #6162. |
Signed-off-by: yaoyu-33 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
Approved c976ced after independent review. The mixed preset keeps all six sandboxless services on loopback under both Docker and OpenSandbox. Pi reports a task-end stop as completed on both the response and the closed invocation, and the stacked merge preserves failed-recovery reporting. Workstation validation passed 202 tests on the head and 204 on the GitHub merge tree (96815b90), with full pre-commit passing on both. Two modules skipped on each run because the private OfficeEnv package was unavailable, so no fresh OfficeEnv model rollout was run.
Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
Re-approved 8032a03 after independent review. The follow-up adds the missing SPDX header. The mixed OfficeEnv bindings and Pi stop behavior passed 202 tests on the head and 204 on GitHub’s stacked merge tree (d369db94). Full pre-commit passed on both. Two private OfficeEnv test modules skipped on each run.
|
/ok to test 8032a03 |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 23f7116 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/46488276593 |
Follow-up commits (review fixes, on top of
a4a47b88aa):8362315d6ffix(core):release_allstops the lent sandboxes at once, and each starting sandbox when its start ends, so one slow start no longer leaves them all running (thread). Test:test_release_all_stops_the_lent_sandboxes_while_a_lend_is_still_starting.75d6f861aefix(officeenv_sandbox): the harness configs sethost: 127.0.0.1on their agent and environment servers, so under NeMo RL'sdefault_hostno sandbox reaches them (thread). Test:test_under_an_explicit_default_host_only_the_servers_a_sandbox_calls_take_the_node_address.d670d26ca3fix(officeenv_sandbox):close_tools_on_task_end: truefor every harness, so calls after the task ends cannot change the grade (thread).check_harnessasserts it for each harness.7da6e832d7refactor(officeenv_sandbox): leaves the mini-SWE pairing to a follow-up PR, which will move it from the deprecatedminiswe_sandboxed_agenttomini_swe_agent/mini_swe_agent_sandboxedand run one realclirow (thread).63e067a40d,a8011c30d7: signed merges of feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162's headsa53810f379ande0c1990002.1e4f436c76fix(officeenv_sandbox): an episode seed keeps the task'sresponses_create_params, as feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162 makes the OfficeEnv server do, sotool_driftis reported. Test:test_an_episode_seed_reports_the_tool_drift_of_its_rows_tools.5373fd0785: signed merge of feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162's head942c31ad60.7bfc24914ebuild(officeenv_sandbox):uv.lockrefreshed against main's bumped root dependencies (build(deps): bump mlflow, GitPython and transitive deps for security fixes #6268: hydra-core, omegaconf, mlflow, gitpython), on a tree shaped like CI's (this branch on feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162's merge ref with main). On this branch alone,uv lock --checkfailed for this server until feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162 contained main.204834ac4a: signed merge of feat(single_agent_turn): drive the agent one step at a time and end the episode on the task state #6162's headf1550cc170, which merges main6aa1fd6a59. From here,uv lock --checkpasses on this branch too.What does this PR do?
Lets Gym's sandboxed harnesses work on OfficeEnv tasks. A new resources server,
resources_servers/officeenv_sandbox, subclasses the OfficeEnv server and gives each episode its own sandbox (Docker or OpenSandbox): the harness works there, and OfficeEnv grades the apps' final state as before.This is the last of three pieces split at review. It builds on #6162 (
single_agent_turn's step loop and OfficeEnv's task state), and #6161 (core session secret and MCP endpoint options) has merged. Until #6162 merges, the diff against main shows it too.The sandboxed server (
resources_servers/officeenv_sandbox)LentSandboxes: anoperatedescriptor for the harness, image, environment and setup per episode. A start runs to its end even when its request is cancelled. A failed seed's stop is tried again at its session's close, and shutdown stops everything within the run's grace./verifystops it before grading.COMPANY_API_URL,company_*tools). Only Gym's node (andtrusted_networks) may seed, verify, read metrics or call the tool routes, and sessions are signed with a secret made for the run (feat(core): session secrets, cookie names and MCP endpoint options for servers that sandboxed code calls #6161'ssigns_sessions_with_run_secret).end_on_task_state): that call, whichever way it came in (MCP tools, a command, an endpoint, the file API), is answered only after the environment server has stopped the run.sandbox_config.start_timeout_s(default 1,800 s) bounds a sandbox's start; raise it for a provider whose creates take longer.host_relay, for a workstation's Docker, needstrusted_workstation: true: the sandbox's traffic then reaches the server from loopback, which the caller check trusts as Gym's own.LentSandboxes(core) gains what this server needed:image,envandsetup;start_timeout_s, a start shielded from cancellation within that limit (without it a cancel cuts the start, as on main, which servers such asopencode_searchexpect); a start the limit cuts before the provider returned the sandbox's id is logged at ERROR with its session, task and labels. Main's OpenSandbox provider deletes the sandbox such a create left (fix(opensandbox): delete the sandbox of a create the caller gave up on #4799); with another provider the log is for a reaper;release_all(timeout_s=...), which refuses new lends, waits for those starting, and logs what may still run.Configs, data and images:
officeenv_sandbox_<harness>_agent,_environment_serverand_resources_server), so several compose in one run;cliandapi_searchrows run as they are. Pi now supports Gym's rollout stop, which this needs. The other harnesses' runs go on until they stop by themselves: Codex CLI supports the stop but is not switched on here, and OpenCode, OpenClaw and Terminus 2 cannot stop a run in flight yet. For all of them,close_tools_on_task_endrefuses the tool and file API calls that come after the task ends;configs/officeenv_sandboxless.yaml, the OfficeEnv server's sandboxless route under the names training rows use (officeenv_sandbox_simple_agent), to run beside them;data/sandbox_pilot.jsonl(OfficeEnv 1.14.2), the first five as its example rows, with Pi's rollouts of them;Validation
At this head (main
d1391e9ffewith #6162), OfficeEnv 1.14.2 installed as the READMEs say:gym env test --resources-server officeenv_sandbox +should_validate_data=true: 150 passed, data validated, with a fake sandbox provider (the held call that ended the task, on the tool route and the file API, among them).gym env test --resources-server officeenv +should_validate_data=true, whose example rows this head emits again with 1.14.2: 50 passed, data validated.responses_api_agents/pi_agent: 417 passed (a run stopped as completed among them).tests/unit_tests/benchmarks/test_officeenv_sandbox_configs.py: 15 passed. It resolves every harness config alone and all of them together, and needs no OfficeEnv, so it runs in CI.tests/unit_tests/server_runtime/test_sandbox_lending.py: 30 passed, a cancelled start under each setting among them; the nine other servers that lend through it (agentic_mme,chartography,deepcad,gdp_pdf,mm_coding_training,opencode_search,swebench,ui_generation_agentic,visual_coding_opencode) pass their suites.-m sandbox): all four shards and the 2,106 sandbox tests pass; combined core coverage 95.12%.scripts/component_locks.pyandpre-commitpass on the changed files,detect-secretsflags only test values, placeholders and pinned commit hashes in them, and every commit is signed off.Rollouts
azure/openai/gpt-5.5on Docker sandboxes at this head, with OfficeEnv 1.14.2, on the five example rows: all at reward 1.0, each run ending at itscomplete_taskcall, stopped as completed. No sandbox was left running after shutdown, no line named one for a reaper, and no held call waited out its bound.+default_hostdoes on a node whose hostname resolves to 127.0.1.1. Gym's own calls reached the server from the node's primary address, which the caller check now admits as one of the node's own.gpt-5.5on Docker: every row was seeded and graded, each routed by its ownagent_ref. Pi stood in for Stirrup, which has no config here. On main4e3f503549with the stop, all 29 Pi episodes (onmcp,tools,api_searchandclirows) ended at theircomplete_taskcall; before the stop, each wrote at least one more message after it.gpt-5.5on Docker: Pi, Codex CLI, mini-SWE, OpenCode, OpenClaw and Terminus 2, 139 rollouts (36 of them just before sandbox mode became its own server), all at reward 1.0.Compatibility and benchmark impact
resources_servers/officeenv_sandbox/configs), and overrides name the harness's server, e.g.++officeenv_sandbox_pi_resources_server.resources_servers.officeenv_sandbox.<option>. The OpenSandbox config goes after the harness configs it serves. Itssandbox_provideris required.server_shutdown_timeout_secondsto 30 s. That timeout is run-wide, and the 1 s default can't stop a collection's sandboxes.nemo-gym[dev,sandbox]and locks thetzdataOfficeEnv pins. OfficeEnv 1.14.2 installs apart into it, as into the OfficeEnv server.workspace_trace_store(optional) keeps the bytes an episode is handed, for replay. A write that fails is logged and counted insandbox_trace_failures, and fails no call.Checklist
resources_servers/officeenv_sandbox/README.md).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code