Repository navigation
fix(opencode): share runtime pin and observability patch - #4288
Merged
Merged
Conversation
Signed-off-by: Giulio Lovisotto <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Giulio Lovisotto <[email protected]>
giuliolovisotto
marked this pull request as ready for review
October 9, 2026 14:18
giuliolovisotto
enabled auto-merge
October 9, 2026 14:18
bxyu-nvidia
previously approved these changes
Oct 9, 2026
Signed-off-by: Giulio Lovisotto <[email protected]>
bxyu-nvidia
approved these changes
Oct 9, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37954303468 |
yaoyu-33
added a commit
to yaoyu-33/Gym
that referenced
this pull request
Oct 9, 2026
…DIA-NeMo#4251) ## What does this PR do? Align conformance with NVIDIA-NeMo#4045: retained HTTP errors belong to an invocation and may have zero or one step reference. Successful policy responses still require a step; compaction calls remain separate. This corrects the P0 check introduced in NVIDIA-NeMo#4192 without inventing turns for failed HTTP exchanges. Also pass the configured assistant-message header to the scripted Model Server's capture middleware, matching normal Model Server startup. Tests cover header retention on HTTP success/failure and reject duplicate links or missing ownership. The OpenCode plugin-loading commit was removed and replaced by the separate shared-runtime PR NVIDIA-NeMo#4288. This PR only changes conformance checks, probe wiring, their tests and documentation. It is rebased on main `77509af61`. ## Validation After removing the plugin-loading commit: ```bash PYTHONPATH=$PWD python -m pytest \ tests/unit_tests/harness_capabilities \ scripts/harness_conformance/tests \ tests/unit_tests/test_harness_conformance_checks.py -q ``` **342 passed, 2 skipped.** Full core and all-server suites were not run locally. The all-files pre-commit check passed on the rebased branch before removing the isolated plugin-loading commit. The fresh four-harness probe run on the rebased branch, before that split, gave OpenCode 5/7, Hermes 7/7, Pi 6/7, Codex 0/7. These are not results for this final split: OpenCode additionally needs the separate plugin setup. Hermes benefits from NVIDIA-NeMo#4048 now on main. Pi's two provider-error classification unit failures remain separate (NVIDIA-NeMo#4285); its HTTP-400 health expectation also remains unresolved. Codex retains independent evidence gaps. No fresh generative-model benchmark is needed for this diagnostic/probe correction. No API migration or reward/scoring change. No new source files; existing licenses retained. All commits have DCO sign-off. --------- Signed-off-by: yaoyu-33 <[email protected]>
Ashish-Soni08
pushed a commit
to Ashish-Soni08/Gym
that referenced
this pull request
Oct 10, 2026
## What / expected Add sandbox sessions to `opencode_agent` using 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. - Include NVIDIA-NeMo#4288's shared runtime pin and model-call attribution plugin in both paths. - Keep failure artifacts and cleanup observations; cap combined diagnostics at 16k characters. Local installation is off-loop and retryable even after all waiters cancel; sandbox ripgrep provisioning is best-effort. - Remove the unshipped execution selector, old-adapter bridge and obsolete cookie. Session requests use an explicit supported-field contract. Existing `opencode_sandboxed_agent` benchmarks, recipes and allowlists stay unchanged; only four required PATH-quoting fixes remain in that adapter. Shared-helper/fixture cleanup is tracked in NVIDIA-NeMo#4306. ## Compatibility / concerns The shipped YAML now selects `${policy_model_name}` through Gym, removing the fixed `nvinf` provider/model example. Removed local example keys (`openai_api_key`, `openai_base_url`, `env`, `workspace_root`, `system_prompt`, `extra_args`, `concurrency`) remain configurable class fields. `thinking` now defaults to **true**, timeout changes **900 → 10800s**, and `resources_server: null` means local `/run` needs 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`, custom `command` and `extra_args` are 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 `rg` warns 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 main `f128d43d3`. The conflict with NVIDIA-NeMo#4172 retains its `opencode db VACUUM INTO` snapshot and our quoted PATH. Pytest selection: both OpenCode agent suites, `responses_api_models/vllm_model/tests`, and core `test_sandbox_session`, `test_sandbox_supervisor_client`, `test_agent_sessions`, `test_agent_session_retries`, `test_add_legacy_agent_environment_servers`, `test_global_config`, plus `test_ray_opt_out`, `test_server_utils` and `telemetry/test_config` after merging main. Run with `--import-mode=importlib -q -o addopts='' -o log_cli=false`; Linux exclusions are named below. - macOS/Python 3.13.14 after merge: **1,382 passed / 43 skips** (39 platform/runtime; four optional `nemo.lens` integration 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. - Linux/Python 3.13.14 after merge: **1,419 passed / 4 skipped / 2 deselected**, including real Linux process-supervision, installer and Node plugin tests. Skipped: optional `nemo.lens` integration. 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 isolated `gym env test` and core-wide coverage were not rerun. - New regressions reproduce 11 pre-fix Linux installer failures (uncached/cached, non-root, no package manager, apt/apk failures), the cancelled-waiter retry failure and oversized combined diagnostics. The fixed focused Linux suite passes **55 tests**; 502 and capture errors share the same bound without duplicating stderr. - Regression checks against the merge-only pre-fix snapshot reproduce plugin/input, diagnostics, cleanup-observation and synchronous-parser defects; the future-field check also fails before the allow-list fix. - Smoke: real OpenCode **1.17.11**, `nvidia/nemotron-3-super-120b-a12b`, Docker sandbox and stock math verifier. On runtime candidate `68fd15170`, 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. - Post-merge borrowed smoke also passes: **reward 1**, **3/3 correlated model calls**, **24,214 tokens**, tool-written answer, paired tool output, retained observations and confirmed cleanup before verification. Resources destroys the borrowed sandbox; task-scoped inventory is empty after the run. The earlier pre-merge smoke also passed (24,262 tokens); neither was rerun for score selection. - These are bounded functional checks, not SWE-Pro accuracy validation. Full current-head CI and maintainer approval remain separate gates; no CI trust-gate authorization is implied. <details> <summary>Earlier benchmark evidence (not rerun on this head)</summary> At `da85bf9ef` (documentation-only follow-up `52d8e12df`), 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. </details> --------- Signed-off-by: yaoyu-33 <[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 changes
Local OpenCode lacked the correlation plugin already enabled by the sandboxed adapter, and the adapters separately selected their runtime versions. Both now use
opencode_agent/runtime.py: one release pin, one unchanged JavaScript patch, and oneapply_observability_patch(...)function. The sandbox only adds the necessary upload of that same file. Existing user plugins are preserved; the patch is enabled with model-call observability.The shared module is 15 lines. The plugin is moved unchanged. Both YAML version duplicates are removed, and the CI installer uses the same default. Configured versions must match the executable, including preinstalled/cached sandbox binaries. Local version mismatches now raise an actionable error instead of warning and continuing. Explicit
opencode_versionoverrides remain supported in both adapters; the default is stock 1.17.11 for the relevant platform.Split from #4251 at Giulio's request. That PR retains the independent checker and scripted-capture header fixes; it contains no plugin-loading change. This PR targets main independently. No reward/scoring changes or binary fork.
Validation
PYTHONPATH=$PWD python -m pytest \ responses_api_agents/opencode_agent/tests \ responses_api_agents/opencode_sandboxed_agent/tests \ tests/unit_tests/test_harness_conformance_ci.py \ scripts/harness_conformance/tests -q python -m pre_commit run --all-files git diff --check302 passed, 2 skipped; all-files pre-commit passed. Tests cover both adapters' plugin configuration, preserved user plugins, capture disabled, the shared CI/default version, actual plugin hooks, and rejecting mismatched binaries before task execution.
Fresh real-runtime smoke artifacts are in
/Users/glovisotto/repos/notes/opencode-shared-runtime-20261009/:evaluation_completed=true. The standalone scripted fixture supplies the normal production assistant-message capture header (the separate runner fix in fix(ci): align harness conformance checks with capture semantics #4251).Source, scripts, logs and fresh artifacts are retained with the report. Full core/all-server suites were not run locally. No new dependencies. New module has the NVIDIA SPDX header; commit has DCO sign-off.