Repository navigation
feat(agent): run OpenCode in task sandboxes - #3639
Conversation
2636190 to
50d1f6b
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-3639-56a3bdce86cf.docs.buildwithfern.com/nemo/gym |
a0e5ab9 to
07be62c
Compare
00db9de to
b5a692e
Compare
…r stack Rebase the TB4 full-swapping integration onto main 17add3c, including mini-SWE refactor #3680 and the merged EnvironmentServer replacement stack #3717, #3718, #3720, #3721, and #3722. Adapt native OpenCode session support from #3639 (dce7f83) and Hermes session hardening from #3554 (6dc9c53). Keep existing legacy entrypoints. Add optional resource-resolved task context, caller-assigned native TB4 sessions, a generic swappable profile, and lifecycle-audited CPU/GPU/Compose smokes. Preserve the mini-SWE CLI/Responses flow while supervising all agent descendants before verification. Honor task users and limits, select sandbox-compatible bootstrap binaries, and avoid an unnecessary root UID switch when preparing the already-executable TB4 verifier. Bind native TB4 close to the merged HTTP hook and confirm destruction, allowing retries after provider deletion failures. Route Hermes iteration-limit summaries through its regular request formatter, preserving reasoning, history, and request settings without leaking internal Responses IDs into chat requests. Signed-off-by: Frederic Lafrance <flafrance@nvidia.com>
|
Why this follow-up is needed in #3639:
The earlier 600-second timeout occurred on main's separate The saved NodeBB trace explains why separating the limits matters: 31 automatic compactions, about 297 seconds in completed compaction messages, 144 file reads, and no edit/write/apply-patch calls. The old 32768 shared-cap workaround also shrank the context: OpenCode 1.17.11's default compaction threshold becomes Validation at |
|
Pushed
Validation: 375 Linux tests passed; local 245 passed / 30 Linux-only skipped; all-file pre-commit passed; Fern 0 errors / 1 warning. The final documentation commit leaves the tested runtime unchanged. The handoff HTML now includes the exact full-prompt preparation command, source pin, result and smoke-only limits. Keeping draft: single-task evidence is not a full baseline, and the existing base-branch conflicts/full CI still need follow-up. |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
ananthsub
left a comment
There was a problem hiding this comment.
Thanks for the thorough follow-up. I checked all 20 threads against the new code, and each one is resolved:
- The rebase onto #4288 is clean, with one version pin and the observability plugin uploaded into sandbox sessions.
- The
execution_modesetting, thelegacy_sandboxbridge, the obsolete cookie check and theremote_*fields are removed. - Defaults and names now match Pi and Codex.
- Request validation is an allow-list, failures keep their artifacts and
stderr.log, and the off-loop parse and install are covered by tests.
The shared-helper cleanup is tracked in #4306. The OpenCode tests pass locally on Linux.
One new issue comes from this round: the ripgrep check in the installer is now a hard requirement, so setup fails on non-root images without rg, and on RHEL-family root images. That one is inline and should be fixed before merge. The other two inline comments are nits.
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 5cfdbae |
Preserve both OpenCode and OpenClaw composition tests. No OpenCode runtime or retained permission candidate changes. Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 8bba306 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38069955548 |
What / expected
Add sandbox sessions to
opencode_agentusing the shared execute/close lifecycle. An agent session runs OpenCode in a borrowed or agent-owned sandbox; no session uses the local CLI. Close confirms cleanup before Resources verifies. Invalid/closed sessions never fall back to the host.Existing
opencode_sandboxed_agentbenchmarks, recipes and allowlists stay unchanged; only four required PATH-quoting fixes remain in that adapter. Shared-helper/fixture cleanup is tracked in #4306.Compatibility / concerns
The shipped YAML now selects
${policy_model_name}through Gym, removing the fixednvinfprovider/model example. Removed local example keys (openai_api_key,openai_base_url,env,workspace_root,system_prompt,extra_args,concurrency) remain configurable class fields.thinkingnow defaults to true, timeout changes 900 → 10800s, andresources_server: nullmeans local/runneeds an explicit binding. Install/close budgets are 600/60s; owned sandboxes need an explicit provider.Local prompt compatibility is preserved; sandbox instructions use a separate file. Sandbox
env, customcommandandextra_argsare rejected. Default permissions apply locally too; subagents are enabled here but remain disabled in the old benchmark profile. These differences can affect scores. One worker; eval-only, with training token capture off by default. No new benchmark baseline is claimed.Missing system
rgwarns and falls back to OpenCode's on-demand download; required runtime prerequisites still fail explicitly. Offline images should preinstall ripgrep. A separately identified input-upload permission issue for non-root Docker with controller umask 077 remains outside this fix; the model smokes below use a root image.Validation
Current head:
5cfdbae0d6167fb055342a5ad2faf89e261975f8; merged mainf128d43d3. The conflict with #4172 retains itsopencode db VACUUM INTOsnapshot and our quoted PATH.Pytest selection: both OpenCode agent suites,
responses_api_models/vllm_model/tests, and coretest_sandbox_session,test_sandbox_supervisor_client,test_agent_sessions,test_agent_session_retries,test_add_legacy_agent_environment_servers,test_global_config, plustest_ray_opt_out,test_server_utilsandtelemetry/test_configafter merging main. Run with--import-mode=importlib -q -o addopts='' -o log_cli=false; Linux exclusions are named below.nemo.lensintegration tests). Final all-file pre-commit and whitespace checks pass. The initial restricted pre-merge run could not bind a test port; permitted reruns pass without exclusions.nemo.lensintegration. Excluded: the previously reproduced vLLM endpoint-mtime failures (test_publish_rebinds_clients_and_clears_sessions,test_unpublished_endpoint_grace_lifecycle); those unchanged model files match main. Canonical isolatedgym env testand core-wide coverage were not rerun.nvidia/nemotron-3-super-120b-a12b, Docker sandbox and stock math verifier. On runtime candidate68fd15170, owned and borrowed episodes both score 1, retain tools/nonzero usage, carry message-ID headers on all three model calls, and confirm cleanup before verification. The owned driver required fixture/capture-path corrections; evidence was retained and the successful episode was audited without a score-driven rerun.Earlier benchmark evidence (not rerun on this head)
At
da85bf9ef(documentation-only follow-up52d8e12df), the HSG SWE-Pro smoke completed official grading with reward 0, 161/178 tests passed. The model hit its output limit without producing a patch. Existing direct/local and borrowed-sandbox smoke evidence remains revision-pinned in the PR history; it is not a score baseline for this revision.