Skip to content

feat(hle,apex_shortlist): run the OpenCode presets through opencode_agent sessions - #5825

Merged
weijiac0619 merged 7 commits into
mainfrom
yuya/hle-apex-opencode-sessions
Nov 10, 2026
Merged

weijiac0619 merged 7 commits into
mainfrom
yuya/hle-apex-opencode-sessions

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

The HLE and APEX Shortlist OpenCode presets ran opencode_sandboxed_agent, a deprecated agent, behind the legacy_agent relay. Their judges (equivalence_llm_judge, math_with_judge) keep no per-rollout state, so the session agent can own its sandbox. This PR moves the presets onto opencode_agent through each benchmark's own single_agent_turn_legacy Environment Server. It follows the naming of #5762: the session presets take the plain names, and the relay presets are renamed *_legacy_agent.yaml and kept, with deprecation notes.

  • benchmarks/hle/opencode.yaml, benchmarks/hle/opencode_search.yaml, benchmarks/apex_shortlist/opencode.yaml: opencode_agent sessions. Each session creates its own sandbox from OPENCODE_SANDBOX_IMAGE (the offline science image), and the benchmark's Environment Server keeps its routing name with the new agent bound. The search preset grants the agent the Tavily server's MCP tools through the agent's tool_servers, which single_agent_turn uses since feat(env): grant MCP tools of extra tool servers to session agents #5551.

  • responses_api_agents/opencode_agent/configs/profiles/offline_science.yaml: the shared settings, merged into the opencode_agent instance each preset inherits once. It composes the generic session profile, profiles/benchmark.yaml, and adds the offline science settings. It carries over the deprecated preset (opencode_sandboxed_agent/configs/benchmark.yaml) wherever opencode_agent has the setting:

    • OpenSandbox and use_absolute_ip;
    • 4 workers × 512 concurrency, a 4-hour timeout, 20-minute readiness, 2 CPUs / 8 GiB, /workspace;
    • a 4.5-hour sandbox TTL: the run budget plus the seed's readiness wait (Round 3 below);
    • network_access: model_only;
    • the image's pinned binary (/usr/local/bin/opencode with the digest the image's Dockerfile checks);
    • the same environment note, now as system_prompt, since opencode_agent refuses instructions files;
    • subagents denied.

    New in this profile: the head server and the agent stay on 127.0.0.1, and absolute_ip_server_types: [responses_api_models] moves only the model server onto the host address (hle/opencode_search.yaml adds resources_servers for Tavily). A sandbox allowed to reach a host reaches every port on it, so the Environment Server and the judge stay off that address.

  • benchmarks/{hle,apex_shortlist}/opencode*_legacy_agent.yaml: the relay presets, unchanged except for the deprecation note and opencode_search_legacy_agent.yaml now loading opencode_legacy_agent.yaml.

  • opencode_agent/app.py: a comment only. mcp_tool_timeout_seconds now gives OpenCode's defaults when it is unset: 30 s to connect and the MCP SDK's 60 s per call.

  • Citations repointed: the configuration troubleshooting page and scripts/add_legacy_agent_environment_servers.py cite opencode_legacy_agent.yaml as the relay example, and the routing test of the relay recipes runs on the renamed files. Both benchmark READMEs describe the session presets.

Left for follow-up PRs

Each of these would change opencode_agent for every preset, so none is made here. The README lists each one as a score difference.

  • execution_failure_reward_zero: the session path has no switch that scores a harness failure as 0.
  • opencode_config: only permission and tools are accepted, so the compaction, step-limit (agent) and title settings of the deprecated preset cannot be carried over.
  • output_token_policy: remaining_context: OpenCode asks for the output cap on every call, so it has no equivalent.
  • Host artifact directory: there is none; rows carry the agent's observations.

Issue

No public issue. This is part of retiring opencode_sandboxed_agent: these presets are its remaining consumers whose Resources server needs no task sandbox.

Compatibility and benchmark-result impact

--benchmark hle/opencode, hle/opencode_search and apex_shortlist/opencode now run opencode_agent; hle/opencode_legacy_agent, hle/opencode_search_legacy_agent and apex_shortlist/opencode_legacy_agent keep the relay. Agent instance names are unchanged (hle_opencode_agent, apex_shortlist_opencode_agent), but the agent type under them changed, so overrides of ...responses_api_agents.opencode_sandboxed_agent.* belong with the _legacy_agent files.

Scores are not comparable across the switch. opencode_agent cannot express everything the deprecated preset set:

  • Output budget. 32,768 tokens per call within a 229,376-token context. OpenCode asks for the output cap on every call, so remaining_context has no equivalent, and asking for the whole 262,144-token window makes vLLM refuse the call.
  • Compaction, step limit, titles. OpenCode's defaults apply: opencode_agent accepts only permission and tools in opencode_config, so the no-compaction setting and the 400-step cap are gone.
  • Failures. A run that stops at its output, context or time limit is graded on what it produced. A harness crash is retried and then reported as a failed rollout. The deprecated preset scored both as 0 (execution_failure_reward_zero); the session path has no switch for that.
  • Commands. opencode_agent's default deny rules apply.
  • Requests. opencode_agent accepts the input, instructions, model, temperature and top_p, and answers 422 to any other request field (for example reasoning or max_output_tokens); the deprecated agent ignored them.
  • Addresses. The deprecated preset bound every server, the head server included, to the host address. Here only the model server does (plus the Resources servers for search), so a client on another host can no longer reach the head, agent or Environment Server. An explicit default_host still applies to every server.
  • Artifacts. There is no host artifact directory; rows carry the agent's observations.
  • Plugin bundle. The image has no plugin-dependency bundle for the private config directory, so an offline session start waits about 70 s for OpenCode's install attempt to fail. The README says how to remove the wait.

Validation

  • gym env validate on all six presets (session and _legacy_agent, with the image and keys set to dummies and ++default_host): valid. gym env resolve of hle/opencode_search.yaml: the agent carries the preset's settings and tool_servers: [tavily], and the Environment Server is single_agent_turn_legacy bound to hle_opencode_agent.

  • pytest tests/unit_tests/tooling/test_add_legacy_agent_environment_servers.py tests/unit_tests/config/test_global_config.py tests/unit_tests/environment/test_session_harness_benchmark_profiles.py tests/unit_tests/test_fern_docs_links.py: passed. tests/unit_tests/environment/test_benchmarks.py::...::test_every_repo_benchmark_appears_in_listing fails on my Mac because its hostname does not resolve for use_absolute_ip; it fails the same way on an untouched origin/main.

  • pre-commit run on the changed files: passed.

  • After the review fixes (965212f): gym env validate on the session presets and hle_diamond/opencode again valid; gym env resolve of hle/opencode_search shows only the model server and the Resources servers (Tavily and the judge, same type) on the host address, and the head, agent and Environment Server on 127.0.0.1. Pre-commit on the changed files passed.

  • Round 2 (main merged, 9f2a1ab):

    • offline_science.yaml now composes profiles/benchmark.yaml. gym env resolve of hle/opencode, hle/opencode_search and apex_shortlist/opencode before and after shows no difference, ignoring ports and the config_paths list.
    • gym env validate on the three session presets and hle/opencode_legacy_agent: valid.
    • pytest tests/unit_tests/environment/test_session_harness_benchmark_profiles.py tests/unit_tests/tooling/test_add_legacy_agent_environment_servers.py responses_api_agents/opencode_agent/tests: 927 passed, 60 skipped.
    • Pre-commit on the changed files: passed.
    • CI on 965212f was green.
  • Round 3 (871e523):

    • offline_science.yaml sets sandbox_config.ttl_s: 16200. The 14,400 s TTL from profiles/benchmark.yaml starts when the seed creates the sandbox, but the 14,400 s run budget only starts after the seed, which waits up to 1,200 s for readiness. A run near its deadline would outlive its sandbox, and a lost sandbox is retried, not graded. feat(hle_diamond): run the text tool presets as opencode_agent and pi_agent sessions #5702 uses the same TTL for HLE Diamond.

    • New responses_api_agents/opencode_agent/tests/test_offline_science_presets.py composes hle/opencode, hle/opencode_search and apex_shortlist/opencode as gym eval loads them and validates the agent config. It checks:

      • routing through each benchmark's single_agent_turn_legacy server;
      • network_access and absolute_ip_server_types;
      • a loopback head server;
      • task: deny placed after "*";
      • a TTL that covers the readiness wait plus the run budget.

      Before the TTL change, it failed only on that last check.

    • pytest responses_api_agents/opencode_agent/tests tests/unit_tests/environment/test_session_harness_benchmark_profiles.py tests/unit_tests/tooling/test_add_legacy_agent_environment_servers.py on 871e523: 968 passed, 22 skipped.

    • Pre-commit on the changed files: passed.

    • main merges into this branch without conflicts, so no merge was added.

  • Round 4 (main merged in c8000d2):

    • main moved the switch tests out of tests/unit_tests/tooling/test_add_legacy_agent_environment_servers.py (perf(ci): AUT-2843 split migration tests for whole-file scheduling #5946), so this PR conflicted there. The relay-recipe routing test now lives in test_agent_environment_harness_overlays.py; the merge keeps main's old file and carries this PR's change to that test (the OpenCode relay recipes renamed *_legacy_agent, the agent name derived from the harness) into the new file.
    • pytest tests/unit_tests/tooling tests/unit_tests/environment/test_session_harness_benchmark_profiles.py responses_api_agents/opencode_agent/tests tests/unit_tests/test_public_api_facades.py tests/unit_tests/test_public_api.py: 2595 passed, 24 skipped. Pre-commit on the changed files: passed.

Rollouts

Real-model pairing runs on a workstation's Docker at 837b356. The 272850b commit after it only marks the pinned digest for the secrets detector. 965212f adds absolute_ip_server_types and doc fixes; it was not re-smoked. The smokes set default_host, which applies to every server regardless of that list, so they would have run the same way.

  • Model and harness. nvidia/nemotron-3.5-super-vl-120b-a12b through a hosted endpoint and Gym's vllm_model server, thinking off. Collection used gym env start + gym eval run --no-serve --limit 1, servers on the docker0 address and the head server on loopback.
  • Smoke-only overrides, applied to a scratch copy of offline_science.yaml. The benchmark presets themselves were not changed. The offline science image is not on this host, so:
    • the Docker provider instead of OpenSandbox;
    • python:3.13-slim instead of OPENCODE_SANDBOX_IMAGE;
    • network_access: inherit, since Docker cannot restrict egress;
    • the OpenCode binary downloaded rather than sandbox_executable_path.
  • Rows. One synthetic row per preset, in the prepared format, because the HLE and APEX data are not in the repo.
Preset Task Request order seen by the servers Result Sandboxes
benchmarks/hle/opencode.yaml smallest prime above 1000, checked in Python /seed_session → /v1/agent_sessions → (agent turn) → /v1/agent_sessions/close → /verify (judge call) → /close_session completed, 2 bash calls, answer 1009; HLE judge reward 1.0, mask_sample: false 1 agent-owned sandbox; none left after shutdown
benchmarks/apex_shortlist/opencode.yaml sum of squares 1..30, checked in Python same order completed, 1 bash call, \boxed{9455}; symbolic grade reward 1.0, mask_sample: false 1; none left
benchmarks/hle/opencode_search.yaml year Philae landed, with the search tools same order completed, 1 tavily_web_search call through the agent's tool_servers, answer 2014; reward 1.0, mask_sample: false 1; none left

The agent session closes before /verify in all three, as single_agent_turn_legacy orders it.

An earlier attempt named a hosted model that answered 404 to every call. That episode ended as a terminal environment_server_failed rollout, with ng_agent_outcome {"failure_kind": "model_request_error", "status_code": 404}, not a scored 0. This matches the README's failure bullet.

Interrupted runs. Two runs killed the agent's sandbox with docker kill partway through, with rollout retries off, to check that a lost sandbox ends as a failed rollout and not a scored 0. The row asked the agent to run sleep 300 before answering.

When the sandbox was killed Request order Result Sandboxes
After the agent's first model call, while its bash call ran sleep 300 /seed_session → /v1/agent_sessions → /v1/responses 500 (OpenCode launch outcome is unknown; cannot confirm termination) → /v1/agent_sessions/close → /close_session non-terminal environment_server_failed in rollouts_failures.jsonl; no /verify, no reward; the run reports no score none left
25 s in, while OpenCode was still installing /seed_session → /v1/agent_sessions 500 (installer killed, exit 137) → /v1/agent_sessions/close → /close_session non-terminal environment_server_failed; no /verify, no reward none left

The search and interrupted runs used the same scratch overrides (for the search preset, network_access: inherit replaced model_and_tools too), with python:3.13-slim under a run-only tag so the kill could target this run's container alone.

Commands to re-smoke the current head on OpenSandbox with the offline science image. Round 3 below ran them with a public image and synthetic HLE rows. Each command takes a gated dataset (Hugging Face token with access in env.yaml), a reachable model endpoint and, for OpenSandbox, the real key and domain.

export OPENSANDBOX_API_KEY=<key> OPENSANDBOX_DOMAIN=<domain>
export OPENCODE_SANDBOX_IMAGE=<offline science image built from responses_api_agents/opencode_sandboxed_agent/offline_science_image>
export TAVILY_API_KEY=<key>   # hle/opencode_search only
for b in hle/opencode hle/opencode_search apex_shortlist/opencode; do
  gym eval run --benchmark $b --split benchmark --model-type vllm_model \
      --model <served model name> --model-url <endpoint>/v1 --model-api-key <key> \
      --limit 2 --num-repeats 1 --output results/smoke_${b//\//_}.jsonl
done

What to check:

  • each row has a reward and mask_sample: false;
  • /verify runs after /v1/agent_sessions/close;
  • no opencode sandbox is left in OpenSandbox after the run;
  • the sandbox cannot reach the judge's port, only the model server's (the absolute_ip_server_types change).

Round 3: OpenSandbox runs at 9f2a1ab. 871e523 (TTL and the config test) was not re-smoked, except for the hle/opencode_search run, which came later and ran at 871e523.

  • Model and harness. A Nemotron checkpoint served by vLLM through Gym's vllm_model server: thinking on, temperature 1.0, top_p 0.95, all set on the model server and not in the request. The runs used gym eval run --benchmark <preset> --split benchmark --limit 2 --num-repeats 1 on the OpenSandbox provider. No default_host was set, so absolute_ip_server_types decided which servers took the host address.
  • Overrides on the composed agent. The presets themselves were not changed. The offline science image is not published, so:
    • OPENCODE_SANDBOX_IMAGE was python:3.11-slim-bookworm;
    • sandbox_executable_path and sandbox_executable_sha256 were unset, so OpenCode downloaded at session start;
    • network_access: inherit, so that download could run.
  • What these runs do not cover.
    • Egress was not restricted: every rollout ran with network_access: inherit, not the presets' model_only (model_and_tools for search). The model_only probe below covers the policy itself.
    • The offline science image was not exercised: no SciPy, SymPy, Sage or Lean, and no preinstalled OpenCode at the pinned path, so sandbox_executable_path and its SHA-256 check did not run.
  • Rows.
    • HLE is gated and this account has no access, so its runs used two synthetic rows in HLE's prepared format: a computation checked in Python and a fact question.
    • APEX Shortlist used its first two prepared rows.
    • hle/opencode_search used one synthetic row that asks the agent to look the answer up with web search and name a source. It ran later, at 871e523, with a real Tavily key; one row only, to stay within the key's quota.
Preset Rows Result Sandboxes left
benchmarks/hle/opencode.yaml 2 synthetic both completed; HLE judge reward 1.0, 1.0; mask_sample: false 0
benchmarks/hle/opencode_search.yaml (at 871e523) 1 synthetic, search completed; one tavily_web_search call; HLE judge reward 1.0; mask_sample: false 0
benchmarks/apex_shortlist/opencode.yaml first 2 both completed; reward 0.0 (answered without tools, wrong) and 1.0 (16 tool calls); mask_sample: false 0
benchmarks/hle/opencode.yaml, probe rows 2 probes (below) both completed; reward 1.0, 1.0; mask_sample: false 0

rollouts_failures.jsonl was empty in every run. "Sandboxes left" is the OpenSandbox cleanup tool's dry run (python -m nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes), filtered to the run's label, after each run.

What else the runs show:

  • Tavily. The search run's one tavily_web_search call returned real results: 10 ranked hits with URLs and summaries, the first being the Wikipedia article on Philae, and no <error>. The Tavily client returns results only on HTTP 200 and raises Tavily HTTP <status> otherwise, so the call got a 200. The agent's answer cites that article. The Tavily Resources server listened on the host address, as absolute_ip_server_types sets for search.

  • Order. Every row has two things:

    • the agent's trajectory, which only /v1/agent_sessions/close returns;
    • the judge's verdict from /verify, which single_agent_turn_legacy calls after the close.

    Server access logs were off, so the request order was not read from the logs as in the earlier rounds.

  • Addresses. During each run, only the model server listened on the host address. The head server and the agent listened on 127.0.0.1, and the Environment and Resources servers on 127.0.0.1 or Unix sockets.

    • A probe row had the agent write and run a script in its sandbox. The script collects every http://<IP>:<port> from the sandbox's config files and environment, then tries every TCP port from 1024 to 65535 on each non-loopback host it found.
    • The script found only the model server's URL. None of the other Gym servers' ports was open on that host.
    • Other ports on the host were open, the vLLM endpoint among them, because these runs used network_access: inherit. The README already notes this: a sandbox that reaches a host reaches every port on it.
  • Subagents. A second probe row asked the agent to compute 17 × 23 with the task tool. Every OpenCode request offered bash, edit, glob, grep, read, todowrite and write, with no task or webfetch. The agent replied that it had no task tool and answered 391. So permission.task: deny does remove the subagent tool in a session.

  • Output cap. Every OpenCode request carried max_tokens: 32768, as the profile sets.

  • model_only probe. A separate sandbox was created on the same OpenSandbox deployment from hle/opencode's composed config, with the egress policy restrict_sandbox_network builds for model_only. The model URL was a stand-in listener on the Gym host. The policy was defaultAction: deny with one allow for the Gym host's IP. From inside the sandbox:

    • the model port on the host address: open;
    • a second port on the host address: open, because the policy allows the whole host, as its docstring says;
    • a port bound only to 127.0.0.1 on the host: refused;
    • 1.1.1.1:443: timed out; pypi.org: no DNS.

    So model_only alone would not keep the sandbox off a judge bound to the host address. Keeping the judge on loopback (absolute_ip_server_types) is what does.

🤖 Generated with Claude Code

…gent sessions

benchmarks/hle/opencode.yaml, hle/opencode_search.yaml and apex_shortlist/opencode.yaml now run
opencode_agent through each benchmark's single_agent_turn_legacy Environment Server. Each session
creates its own sandbox from the offline science image, reaching only the model server (and the
Tavily server for search, granted through the agent's tool_servers). The shared settings live in
responses_api_agents/opencode_agent/configs/profiles/offline_science.yaml and follow
opencode_sandboxed_agent's benchmark preset where opencode_agent has the setting; the benchmark
READMEs list what differs (output budget, compaction and step limit, failure handling, command
rules, artifacts).

The relay presets are kept as *_legacy_agent.yaml with deprecation notes, and their citations
(the configuration troubleshooting page, the migration script's message and its routing test)
are repointed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33

yaoyu-33 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 837b356

…x string

The secrets detector flags the SHA-256 of the image's OpenCode binary in the offline science preset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 272850b

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior labels Nov 8, 2026
… server and correct the docs

Scope use_absolute_ip to the model server in the offline science profile, and to the
model and Resources servers in hle/opencode_search, so a sandbox allowed to reach the
model server's host does not also reach the Environment and judge servers bound there.

Docs: list the request fields opencode_agent refuses, scope the shared OpenCode/Pi guide
to the *_legacy_agent presets, update the opencode_agent README for the migrated
presets and the new profile, correct OpenCode's MCP timeout defaults, and point the
Diamond OpenCode header at hle/opencode_legacy_agent.yaml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 965212f

yaoyu-33 and others added 2 commits November 8, 2026 22:01
…ile on profiles/benchmark.yaml

The profile repeated the address, head server, provider, network and sandbox-lifetime settings of
profiles/benchmark.yaml. It now composes that profile and keeps only what the offline science presets
add; the resolved HLE, HLE search and APEX Shortlist configs are unchanged. The mcp_tool_timeout_seconds
comment now gives OpenCode's defaults: 30 s to connect and the MCP SDK's 60 s per call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9f2a1ab

…seed and the full run

The 14,400 s TTL from profiles/benchmark.yaml starts when the seed creates
the sandbox, but the 14,400 s run budget only after the seed, which waits
up to 1,200 s for readiness. A run near its deadline would outlive its
sandbox, and a lost sandbox is retried, not graded. Set the TTL to the run
budget plus 1,800 s, as HLE Diamond's session presets do.

Add a test that composes the three presets as gym eval loads them and
checks the routing, the addresses, the subagent denial, and that the TTL
covers the readiness wait plus the run budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
main moved the switch tests out of
tests/unit_tests/tooling/test_add_legacy_agent_environment_servers.py
(#5946); the relay-recipe routing test now lives in
test_agent_environment_harness_overlays.py. Take main's version of the old
file and carry this branch's change to that test (the OpenCode relay
recipes renamed *_legacy_agent, and the agent name derived from the
harness) into the new file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
weijiac0619 added a commit that referenced this pull request Nov 10, 2026
…sessions

Brings in #5825's merge of main. main moved the relay-recipe routing test
into tests/unit_tests/tooling/test_agent_environment_harness_overlays.py
(#5946); take the old file as main has it and rename the Pi relay
recipes to *_legacy_agent in the moved test, as this branch did before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
@weijiac0619

Copy link
Copy Markdown
Contributor

/ok to test c8000d2

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

/ok to test c8000d2

@weijiac0619, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@weijiac0619

Copy link
Copy Markdown
Contributor

/ok to test c8000d2

@weijiac0619
weijiac0619 added this pull request to the merge queue Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42908217834

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42908313172

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@weijiac0619
weijiac0619 added this pull request to the merge queue Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42911743473

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP

I found three non-blocking documentation and test-contract issues. I found no newly introduced runtime blocker in the session routing, grading, sandbox setup, or retained relay presets.

This was a static review; I didn't execute tests or rollouts. The supplied smoke evidence covers real model calls, Tavily, grading, and cleanup, but doesn't exercise the exact offline-science image together with the presets' restricted egress.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread benchmarks/hle/README.md
- Output budget: 32,768 tokens per model call within a 229,376-token context. OpenCode asks for the output cap on
every call, so the deprecated preset's `remaining_context` policy has no equivalent, and asking for the whole
262,144-token window makes vLLM refuse the call.
- Compaction, the step limit and session titles follow OpenCode's defaults: `opencode_agent` accepts only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE — Suggestion: distinguish omitted controls from unsupported controls

This bullet and its APEX counterpart say the adapter cannot carry over compaction and build-step settings. The current _session_opencode_config_error accepts compaction.auto and agent.build.steps; these presets simply don't set them. Users following this guidance could abandon supported benchmark controls unnecessarily.

Replace the complete bullet in both READMEs with:

- Compaction, the step limit and session titles follow OpenCode's defaults in these presets. The session adapter supports `compaction.auto: false` and `agent.build.steps: 400`, but these presets don't set them. It doesn't support the deprecated preset's `compaction.prune` or title-agent override. The build-step limit asks for a final answer rather than enforcing a hard stop.

Keep the score-comparability warning and the current preset settings unchanged. Static acceptance: both bullets should match the validator and retain the distinction between supported compaction.auto/agent.build.steps and unsupported compaction.prune/agent.title.disable. The existing test_compaction_and_build_steps_reach_opencode must retain its assertions that auto: false and steps: 8 reach OpenCode in both prompt modes without changing shared configuration. I inspected, but didn't execute, that test.

Comment thread benchmarks/hle/README.md
as 0 (`execution_failure_reward_zero`).
- Commands: `opencode_agent`'s default rules (destructive commands, Git network and history mining) apply, and
subagents stay denied.
- Requests: `opencode_agent` accepts the input, `instructions`, `model`, `temperature` and `top_p`, and refuses

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE — Suggestion: document the accepted request output-limit case

The blanket rejection of max_output_tokens here and in the APEX bullet contradicts _session_input: a request limit at least as large as the configured cap is accepted. For these presets, 32768 and 65536 are accepted; 32767 is rejected. This matters for callers such as NeMo RL that put the limit on every row.

Replace the complete Requests bullet in both READMEs with:

- Requests: `opencode_agent` accepts the input, `instructions`, supported `model` aliases, `temperature` and `top_p`. A request `max_output_tokens` of at least 32,768 is accepted; OpenCode still uses the preset's 32,768-token cap per call. A smaller limit or another unsupported control, such as `reasoning`, returns 422; the deprecated agent ignored those controls.

Preserve the distinction between a per-call cap and a total-session budget: an accepted larger request value neither raises the configured cap nor limits the sum across calls. Acceptance: with a seeded session configured for 32768, omitted/equal/larger limits should be accepted and 32767 should return 422 before launch; reasoning.effort should remain rejected. Retain the existing output-limit regression, including its HTTP 200 assertions for equal/larger limits and unchanged configured OpenCode cap. These are source-based checks, not executed results.

permissions = settings.opencode_config.permission
assert permissions.task == "deny"
assert list(permissions).index("*") < list(permissions).index("task")
# Only the servers a sandbox must reach take the host address; the judge and the head server stay on loopback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE — Suggestion: scope the loopback claim to the non-search presets

The search case doesn't keep the judge on loopback. Its absolute_ip_server_types includes all Resources servers, so a normal non-offline parse assigns the host address to both Tavily and the HLE judge. The resolver applies this by server type, and the egress policy permits every port on an allowed host. The current offline=True test checks the type list and head address, not the claimed judge isolation. This exposure existed in the base preset; the new issue is the inaccurate assurance here and in the HLE reachability description, not a newly introduced vulnerability.

Replace this comment with:

    # Search exposes both Tavily and the judge by server type; non-search keeps the judge on loopback.

Update the HLE description to state that search also exposes the judge and that host allowlisting doesn't isolate ports. This correction needn't change runtime settings; preserve Tavily's MCP grant, model_and_tools, and the loopback head, agent and Environment Server.

Proposed acceptance: resolve each preset non-offline with hostname resolution stubbed to 192.0.2.20, no explicit default_host, and stubbed port allocation. For search, expect the model, Tavily and judge hosts to be 192.0.2.20; expect the head, agent and Environment Server to remain 127.0.0.1. For both non-search presets, expect the judge to remain 127.0.0.1. The documentation and test comments should describe those results. I haven't executed this check.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@weijiac0619
weijiac0619 added this pull request to the merge queue Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42916310052

Merged via the queue into main with commit 4fec9cf Nov 10, 2026
70 checks passed
@weijiac0619
weijiac0619 deleted the yuya/hle-apex-opencode-sessions branch November 10, 2026 22:50
weijiac0619 added a commit that referenced this pull request Nov 10, 2026
main now has #5825 as a squash commit, so the branch's copies of #5825's
commits conflicted with it in the HLE and APEX Shortlist READMEs,
opencode_sandboxed_agent/README.md and the relay-recipe routing test.
Each takes main's version plus this branch's own change to it (the Pi
preset and relay-recipe edits); the branch's diff against main is now
only the Pi change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>

This branch was previously deployed

1 inactive deployment
public — c8000d2e Deployed Nov 10, 2026 by copy-pr-bot[bot] via release / finalize / notify #11583
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants