Repository navigation
feat(terminus-2): episode sessions on the environment server's sandbox (M7) - #3729
Conversation
f085217 to
53b9079
Compare
4cb0110 to
856ecb5
Compare
856ecb5 to
b2d3e93
Compare
b2d3e93 to
8650709
Compare
8650709 to
32282f0
Compare
32282f0 to
f53cfde
Compare
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Thanks for the session integration. I found three additional error-handling gaps and one nonblocking diagnostic issue, detailed below.
f5d2d44 to
e22da26
Compare
5f5c6e8 to
3f0134b
Compare
|
/ok to test 3f0134b |
|
/ok to test 1a4d594 |
|
/ok to test fa2e823 |
|
/ok to test 3fd902c |
|
Status at the new head 3fd902c. Every thread from the 9 Oct and 15 Oct reviews has its reply inline, so one pointer each: the task MCP servers and skills refusal (supports_task_tool_context, a 422 before the turn), the close carrying the run's observations and now the harness trajectory too (AgentCloseSessionResponse.trajectory, with test_session_decisions_survive_saved_projection as the saved-output regression), the 422 for sessions with several workers, the bounded model client that raises ModelUnreachableError instead of running to the deadline, the narrowed infrastructure status set so a bare 500 is scored, structured sandbox failures as 503, completion on the last turn told apart from step_limit, the template contract restored (resources_server in the shipped YAML, null only on the generated instance), and session activation deduplicated and joined before close. From the rebase: main's try/finally sandbox release and checkpoint helpers in base_responses_api_agent.py were kept, and the sandboxed harnesses now declare calls_model_from_sandbox on their class. Terminus 2 deliberately does not, since it calls the model from its own process, which is what your P3 on #3675 asked for. |
|
Thanks for the fixes. The other 11 review threads are resolved; one remaining item is detailed here: preserve decision history and command-batch counts in saved failure records, with a regression test. I reopened the existing thread for that final fix. |
|
/ok to test debf3c6 |
|
/ok to test 2d50b93 |
|
/ok to test 14e4586 |
|
The reopened thread is fixed at head 14e4586. SingleAgentTurnFailure now carries the trajectory, the Harbor environment server and the generic single agent turn server set it on the agent error, verification and deadline failures, and the failures sidecar row keeps it, so saved failure records preserve the decision history and command-batch counts. The regression test is in responses_api_agents/terminus_2_sandboxed_agent/tests/test_observability.py and the thread has the detail. |
ffrujeri
left a comment
There was a problem hiding this comment.
Approving 14e4586e. All review threads are resolved, including the reopened failure-record one: the trajectory now rides on SingleAgentTurnFailure and reaches the failures sidecar. I checked the one-activation session (an identical retry joins the shielded task, a different body gets a 409, close owns cancellation), the task tool-context refusal, and the bounded model client: 429 and 503 are still waited out under max_rate_limit_wait_seconds, and only refused connections and gateway errors surface within about 10 s. Harbor, single agent turn, Oracle, sessions, CLI and rollout-collection suites pass locally (1423 passed); the Terminus 2 suite passes in CI's server shards. Title and body updated to the environment-server layout.
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Approving 14e4586e as part of the Harbor stack. The existing review requests are addressed, including failure-record trajectory support here and Harbor's forwarding in #4663, included through #4664.
Rechecked 65 focused repository tests and 3 independent failure-projection probes; all passed. The probes preserved the original decision references and nonzero command-batch counts. Model and sandbox operations were faked; no fresh real-model rollout was run in this review.
|
/ok to test 256239b |
ffrujeri
left a comment
There was a problem hiding this comment.
Re-approving 256239b2 after the restack. The only patch change against the approved 14e4586e is the test_harbor_tasks.py adjustment for #3675's absolute_ip_server_types. Stack tests pass locally; CI was still running at approval time.
|
/ok to test 7c1f173 |
…x (M7) M7 of the Harbor tasks RFC. `terminus_2_sandboxed_agent` gains episode sessions that borrow the environment server's sandbox over `SandboxAccess` and disconnect on close, alongside the existing owned-sandbox path. Model calls carry the episode's rollout id. Infrastructure outcomes (model unreachable, sandbox lost, cancellation) fail the request with a 5xx so the episode is recorded as a masked failure instead of an unmasked zero; timeouts and step limits are still verified. The task's `[agent].timeout_sec` from the row metadata bounds the run when it is shorter than the configured budget. Replayed history items get well-formed ids. Session state is process-local: the generated Harbor run config pins the harness to one worker and the agent refuses to seed a session otherwise. The agent serves sessions through the base hooks (main's session contract). The harness's `resources_server` reference is now optional, as it already is for Hermes and mini-SWE: only the legacy `/run` route seeds and verifies through a resources server, and it answers 422 without one. Episode sessions get their sandbox from the environment server. `gym eval run --agent NAME` refuses ambiguous short names: `hermes` and `terminus_2` each match two harnesses, so the caller picks the full name. Squashed from the previous branch and re-applied onto the environment server. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 9b5e539 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39680939231 |
What does this PR do?
M7 of the Harbor tasks RFC (GitLab MR 340, MR 354):
terminus_2_sandboxed_agentruns on the sandbox theharborenvironment server seeds. Stacked on #3706 (M6).seed_agent_sessionconnects to the environment server's sandbox overSandboxAccess(provider config ref plus descriptor) andclose_agent_sessiondisconnects without stopping it.resources_serveris optional: only the legacy/runpath needs it. The existing owned-sandbox/runpath keeps its flow. Model calls carry the episode's rollout id.msg_/rs_ids. OpenAI-compatible Responses backends reject an empty id, which failed every Terminus turn after the first.num_workersis not 1 (a 422, so the environment server records a terminal seed failure instead of retrying), and the generated run config pins it to 1. With 4 workers, 50 of 89 episodes were dropped with 404 unknown session.gym eval run --agent NAMErefuses ambiguous short names.terminus_2andhermeseach match two harnesses, so the full folder name is needed._sandboxed_agentis accepted as a suffix. The README and the error text now show--agent hermes_agent.supports_task_tool_context(default false). The Harbor environment server refuses a task that declares[[environment.mcp_servers]]orskills_dirto a harness that did not declare support, as a terminalstage: agentfailure, instead of scoring a silent zero.AgentCloseSessionResponse.trajectorycarries the harness's own turns. The Harbor and generic single agent turn environment servers forward it on the result (ng_trajectory) and on failures (SingleAgentTurnFailure.trajectory), so saved rows keep decision history and command-batch counts instead of rebuilding turns from every captured model call.Review fixes (2026-10-04)
terminus2_outcome,terminus2_completedand the error type.[agent].timeout_secbounds the run when it is shorter than the configuredsandbox_timeout. Non-numeric values are ignored with a warning./run. On an infrastructure failure the owned-sandbox path stops its sandbox and re-raises the 5xx.Validation
pytest responses_api_agents/terminus_2_sandboxed_agent/testsruns in the server venv; CI's server suite passes at 14e4586.pytest environment_servers/harbor/tests environment_servers/single_agent_turn/tests responses_api_agents/harbor_oracle_agent/tests tests/unit_tests/test_agent_sessions.py tests/unit_tests/test_cli_main.py tests/unit_tests/test_global_config.py tests/unit_tests/test_harbor_tasks.py tests/unit_tests/test_harbor_validation.py tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_add_legacy_agent_environment_servers.py: 1423 passed at 14e4586 (reviewer rerun).ruff checkandruff format --checkclean on the changed files at the rebased head.pre-commit run --files <changed files>was clean before the rebase.Rollouts
Exercised by the TB2.1 parity run in the M8 PR of this stack: 88 of 89 tasks completed through this agent on x86 OpenSandbox, 72 passed, against 70 of 89 on the existing
terminal_bench_2_1server. See that PR for the tables. Those runs predate the move to the environment server, the infrastructure-failure fix and the trajectory forwarding above.Compatibility and benchmark impact
The
benchmarks/terminal_bench_2_1configs are unchanged. The legacy/runpath changes only on infrastructure failures, where it now stops its sandbox and returns a 5xx instead of a verified zero. The id change affects only replayed history items.--agent hermesand--agent terminus_2now need the full folder name.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code