Repository navigation
feat(hle_diamond): run the text tool presets as opencode_agent and pi_agent sessions - #5702
Conversation
Benchmarks that grade a harness started inside the task container (Harbor's agents) need Pi to run with its own tools and prompt, call the benchmark's model endpoint, and leave logs where the verifier side collects them. Pi's sandbox sessions could only call a Gym model server with Gym's runtime guards, and they lost Pi's context-limit outcomes with Pi 0.80.10. All new settings are off or empty by default, so existing configs behave as before: - model_base_url and model_api_key: Pi calls an OpenAI-compatible endpoint directly from the sandbox instead of a Gym model server (set exactly one). Gym does not capture those calls. - thinking_level_map and provider_compat for the generated provider, so that `--thinking max` can send chat reasoning_effort "max"; settings merged recursively over Gym's settings.json (for example retry counts). - sandbox_env, and sandbox_runtime_guards: false to run Pi's own tools and system prompt without Gym's bash cap and prompt note. - session_prompt_cache_key: one prompt_cache_key per session on every call, so a gateway that routes on it keeps the session on one replica. - sandbox_logs_dir and log_requests: Pi's JSON events (pi.txt), its stderr and a per-request log without the conversation in a sandbox directory such as Harbor's /logs/agent. - raise_oom_score_adj: Pi and its tools become the memory-cgroup OOM killer's preferred victims, not the exec daemon or the supervisor. - verify_after_agent_error: a Pi run that failed while its sandbox still runs and answers is returned as a gradable failed response, as Harbor grades after any agent exit, unless its terminal error is a transient model-endpoint failure (after Pi's own retries) or cleanup is unconfirmed. The runner drops Pi's streaming message_update and tool_execution_update events, which repeat the whole partial message on every delta, so long turns no longer grow the event log quadratically. Pi 0.80.10 routes extension console output to stderr in JSON mode, so outcome.mjs writes its records to a session file that the runner appends to the event log; before, context-limit outcomes never reached the adapter in sandbox sessions. Local runs keep printing them. The task's HOME, the agent timeout from the task metadata and the runner's cleanup on capture errors are upstream behaviour and unchanged. Signed-off-by: gwarmstrong <[email protected]>
opencode_agent sandbox sessions could only call a Gym model server. A benchmark that grades a harness started in the task container, as Harbor runs OpenCode, has the harness call the model endpoint itself, and routing those calls through a Gym model server changes the requests the endpoint sees. model_base_url and model_api_key (both unset by default) point the session's OpenAI-compatible provider at an endpoint the sandbox reaches, sending `model` as the model ID; set exactly one of model_server and model_base_url. Gym does not capture those calls, so the model-call correlation plugin is not loaded for them. Sessions with a model server and local calls are unchanged. Signed-off-by: gwarmstrong <[email protected]>
A sandbox session's provider sent no reasoning effort, replayed reasoning only as reasoning_content, capped every call at max_output_tokens and told OpenCode the model's size, so it compacted before the endpoint's real limit. A harness started in a task container with its own model config does none of that, and some endpoints read the replayed reasoning from another field. Four settings, whose defaults keep today's requests: - reasoning_effort: the model's reasoningEffort option, sent as chat reasoning_effort on every request. - interleaved_reasoning_field: the assistant-message field that replays each turn's reasoning (default reasoning_content). - output_token_policy: remaining_context loads a plugin that drops max_tokens from the session provider's requests, so the endpoint picks the output budget, as opencode_sandboxed_agent's policy of that name does. - declare_model_limits: false leaves the model's size unknown to OpenCode, which then compacts only when the endpoint reports an overflow. Signed-off-by: gwarmstrong <[email protected]>
Two gaps kept a sandbox session from running OpenCode the way a harness started in the task container does: - Task images without a WORKDIR start in /, and sessions rejected that workdir because the adapter's runtime and session files under /tmp sit inside it. allow_root_workdir accepts exactly / (the files stay under /tmp, as a harness's own files do there); /tmp and the adapter's own directories are still rejected, and other workdirs keep the full overlap check. - A launcher that passes the instruction as one argument, as Harbor 0.24's opencode agent does, makes `opencode run` wrap it in double quotes (inner quotes escaped) before the model sees it. Sessions send the instruction on stdin, unquoted. argv_prompt_quoting sends the text OpenCode builds from that argument instead. Both are off by default. Signed-off-by: gwarmstrong <[email protected]>
Harbor runs the verifier after any agent exit that is not a timeout, so a trial whose agent died while its sandbox still answers is graded, not rerun. opencode_agent sessions raised an execution error for every failed OpenCode run (a nonzero exit, an error on an assistant turn, no terminal result), so the Environment Server skipped verification and retried the episode from scratch: an OpenCode the kernel's OOM kill hit, one whose own pkill hit it, or a request the endpoint rejected. verify_after_agent_error (off by default) returns such a run as a `failed` response (`incomplete` when it also hit its time limit), with the error in metadata.graded_agent_error, which Resources grades as a nonzero agent exit. It applies only when the supervisor confirmed cleanup, the run's session export was read, the last assistant turn's error is not a transient model-endpoint failure (OpenCode's retryable APIError: 429, 5xx, reset or lost connections, header and stream timeouts) and the sandbox still reports running and answers a probe command. Anything else stays an execution error and is retried. raise_oom_score_adj (off by default) makes OpenCode the OOM killer's preferred victim in its sandbox, as codex_agent's setting of that name does: the runner raises its own oom_score_adj, which OpenCode and its tools inherit, to 1000, or to 0 when the sandbox starts it below zero. The exec daemon and the supervisor keep the sandbox's own score. Signed-off-by: gwarmstrong <[email protected]>
Sandbox sessions pass the instruction to `claude -p` as an argument after `--`. Harbor 0.24's claude-code agent pipes it on stdin instead, and on a command line the task's own words are a target: an agent that runs `pkill -f <word from its task>` stops its own Claude Code. instruction_on_stdin (off by default) leaves the instruction out of argv and has the runner feed it to the CLI on stdin from a session file. Without it, the runner keeps stdin empty, as before. Signed-off-by: gwarmstrong <[email protected]>
Running Claude Code against a self-hosted model the way its provider's Claude Code guide configures it needs three client settings the agent could not express: the reasoning effort (`--effort`, which Harbor passes from its reasoning_effort), the per-call output cap (CLAUDE_CODE_MAX_OUTPUT_TOKENS) and further client environment such as API_TIMEOUT_MS or CLAUDE_CODE_AUTO_COMPACT_WINDOW. A settings file on the agent host could carry environment, but not from a run config, and not the CLI flag. reasoning_effort, max_output_tokens and extra_env (all unset by default) apply to local and sandbox launches alike. extra_env rejects the variables the agent sets itself (endpoint, credentials, model, CLAUDE_CONFIG_DIR, the output cap), and YAML integers become strings. Signed-off-by: gwarmstrong <[email protected]>
A task image without a WORKDIR lends "/" as its working directory, and sandbox sessions refuse it because the runtime and session files under /tmp sit inside it, so every such trial fails at session start while a harness started in the container runs there. allow_root_workdir (off by default) accepts exactly "/". The runtime and session files stay under /tmp; /tmp itself, the adapter's own directories and relative or `..` paths are still refused. Signed-off-by: gwarmstrong <[email protected]>
…essions Before Harbor 0.24 installs Claude Code in a task container, its claude-code agent runs ensure_system_dependencies for curl, bash, nodejs, npm and procps: each one whose commands are missing is installed as root with the first package manager found. Agents graded under Harbor therefore have node, npm, ps and pkill even where the task image lacks them, and a sandbox session that skips the step runs Claude Code in a different environment. harbor_system_dependencies (off by default) runs the same decisions as one POSIX sh script (system_dependencies.py: Harbor's checks, package names, manager order and install command lines, logged line by line) before the session installs Claude Code, bounded by system_dependencies_timeout_seconds (default 1800). Where Harbor errors the trial on a failed install, the session logs the failure and runs Claude Code anyway. The script's tests run it under real shells with stand-in package managers. Signed-off-by: gwarmstrong <[email protected]>
Signed-off-by: gwarmstrong <[email protected]>
… extension writes them Signed-off-by: gwarmstrong <[email protected]>
Signed-off-by: gwarmstrong <[email protected]>
Signed-off-by: gwarmstrong <[email protected]>
Signed-off-by: gwarmstrong <[email protected]>
…dbox-opt-ins Signed-off-by: gwarmstrong <[email protected]> # Conflicts: # nemo_gym/agent_utils/sandbox_session.py # responses_api_agents/opencode_agent/app.py # responses_api_agents/pi_agent/app.py # responses_api_agents/pi_agent/tests/test_sandbox.py
With verify_after_agent_error, Pi and OpenCode graded any failed run while the sandbox still ran. A run the harness runner could not start (exit 125, 126 or 127), a Pi run whose Gym MCP tools did not load (exit 78), or an OpenCode run whose required Gym MCP tools did not connect or were never confirmed is a setup failure: it now stays an execution error and is retried, never graded as the agent's result. Signed-off-by: gwarmstrong <[email protected]>
…dbox-opt-ins Signed-off-by: gwarmstrong <[email protected]> # Conflicts: # responses_api_agents/opencode_agent/app.py # responses_api_agents/pi_agent/app.py # responses_api_agents/pi_agent/tests/test_sandbox.py # tests/unit_tests/test_harness_runner.py
The deprecated pi_sandboxed_agent and opencode_sandboxed_agent each ship a configs/benchmark.yaml profile. A caller that composes a benchmark itself, such as an evaluation framework that runs HLE, loads that profile instead of naming a Resources server. The session harnesses that replace them had no such profile, so moving those callers off the deprecated agents meant copying the `resources_server.name: ???` binding into the caller, where some config systems reject a mandatory-missing value. Add the same profile to pi_agent, opencode_agent, codex_agent, openclaw_agent, hermes_agent and claude_code_agent, at configs/profiles/benchmark.yaml. Each leaves the Resources server unset, so Gym composes the agent onto the benchmark's own agent instance, and each session creates its own sandbox through the `sandbox` provider at an absolute address. The Claude Code profile also points the CLI at the `policy_model` Gym model server. Image, limits and prompts stay with the caller. Agent discovery reads only the top level of configs/, so, like opencode_agent's permission profiles, these are not listed as standalone agent variants. Signed-off-by: gwarmstrong <[email protected]>
A session agent got tool grants only from its episode's own Resources server, so the HLE search presets, which add a Tavily server through tool_servers, had no session path and stayed on the deprecated sandboxed agents. single_agent_turn now takes tool_servers: each episode seeds its own session on every listed Resources server, with the episode's task data, grants that server's MCP tools as a required MCPToolAccess, and closes the session at cleanup. Unset, it falls back to the bound agent's tool_servers, declared on the base agent config, so a pairing moved off the legacy_agent relay keeps the tool servers its /run seeded, and a harness overlay can add search without naming generated instances. As with the Resources server's own MCP grant, an episode that grants one restarts from its input after a crash. Signed-off-by: gwarmstrong <[email protected]>
Benchmarks whose Resources server supplies no sandbox, such as HLE, have pi_agent create one per session. pi_sandboxed_agent ran those sandboxes with model-only egress; pi_agent could not, so a reasoning benchmark moved to agent sessions would gain open internet. - network_access (inherit, model_only, model_and_tools) sets an OpenSandbox egress policy on a sandbox the agent creates. A borrowed task sandbox keeps its owner's network, so a session that borrows one rejects any other value. The policy helper, restrict_sandbox_network, lives in nemo_gym.agents.utils.sandbox_network and is exported from nemo_gym.agents so other session agents can share it. - sandbox_runtime_dir points setup at a runtime baked into the image and checks its version, since a model-only sandbox cannot download Node or Pi. Signed-off-by: gwarmstrong <[email protected]>
Match pi_agent so reasoning benchmarks without task sandboxes can move off opencode_sandboxed_agent with the same model-only network: network_access (inherit, model_only, model_and_tools) sets the OpenSandbox egress policy on a sandbox OpenCode creates, and a session that borrows a task sandbox rejects any value other than inherit. It cannot be combined with sandbox_config.provider_options.network_policy. The policy comes from the shared restrict_sandbox_network helper, imported from nemo_gym.agents. The preinstalled runtime path already exists (sandbox_executable_path). Signed-off-by: gwarmstrong <[email protected]>
…dbox-opt-ins Signed-off-by: gwarmstrong <[email protected]> # Conflicts: # nemo_gym/agents/__init__.py # responses_api_agents/pi_agent/tests/test_sandbox.py
Startup now also rejects a tool server that is not a Resources server, the episode's own Resources server, and a Resources server without expose_tools_over_mcp, each of which otherwise failed every episode. The partner_if_dispatcher and nooa_agent tests build this server from a bare client, so they now pass tool_servers=[] instead of reading their agent's. The README separates the Resources transports from tool-server grants and says every seeded session is closed. Signed-off-by: gwarmstrong <[email protected]>
Composed onto HLE, every session harness rejected the first seed with a 422. HLE's Environment Server grants the agent its Resources server over direct_http, which no session harness can use; HLE Diamond, GPQA and APEX Shortlist do the same. The judge offers the agent no tools, so each adapter README now gives the pairing setting that clears the grant, `resources_tool_transports: []` under the benchmark's Environment Server. The profiles also fill the gaps an episode reached after that: - Claude Code pins `claude_code_version: "2.1.108"`, which sandbox sessions require. - Each profile declares `sandbox_config` with a mandatory image, so a missing image fails at resolve and the image can be set under the composed agent's name. All but Hermes set `ttl_s: 14400`, without which OpenSandbox ends the sandbox after 10 minutes; Hermes derives its TTL from its own timeouts. - `head_server.host` stays on 127.0.0.1. `use_absolute_ip` otherwise puts the head server, whose config endpoint is unauthenticated, on the address sandboxes reach. A new test composes each profile onto HLE, seeds the composed agent with the request HLE's Environment Server builds, and checks that the seed reaches sandbox creation with the setting and is refused without it. Signed-off-by: gwarmstrong <[email protected]>
equivalence_llm_judge, math_with_judge and mcqa register no tool routes, but their Environment Servers granted the agent their Resources server over direct_http, a leftover of #4953's switch from the legacy_agent relay. Every config of these servers binds simple_agent, which accepts a seed with no grant, so dropping the transport changes nothing for it. A session harness, which rejects a required direct_http grant, now runs HLE, HLE Diamond, GPQA and APEX Shortlist without a per-benchmark override. The adapter READMEs and profile comments drop that override. The profile test now seeds each composed agent through HLE as shipped, and keeps a case that grants direct_http to show the 422 still guards pairings whose Resources server serves tools. Signed-off-by: gwarmstrong <[email protected]>
The core test that seeded each composed agent imported all six adapters, so core coverage measured their modules, about 6,700 statements that only the adapters' own suites exercise, and fell to 87.57%, under its 95% floor. The seed check now lives in tests/session_harness_profiles.py and runs from a test in each adapter's suite, in that adapter's environment, which also runs the Hermes case that the core venv had to skip. The core test keeps the config-only checks. Signed-off-by: gwarmstrong <[email protected]>
#5550 moved the HLE seed check out of the core test into each adapter's suite. This applies this branch's change there: the seed test runs through HLE as shipped, with a case that grants direct_http to keep the 422, and the core test reads the unset transports as empty. Signed-off-by: gwarmstrong <[email protected]>
…dbox-opt-ins Signed-off-by: gwarmstrong <[email protected]> # Conflicts: # responses_api_agents/opencode_agent/app.py
Signed-off-by: gwarmstrong <[email protected]>
use_absolute_ip gave the agent server the address sandboxes reach. An unseeded request to its /v1/responses runs the harness on the Gym host with its built-in tools, so a sandbox could start one there. Each profile now binds its agent to 127.0.0.1, like the head server; only the model server, which the sandboxes need, takes the reachable address. No adapter's sandbox calls its own agent server. Signed-off-by: gwarmstrong <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
Thanks for this. The session presets compose the same offline_science profiles as benchmarks/hle, and a test holds the two benchmarks' agents equal apart from the judge and dataset. Every behaviour claim we checked in the Compatibility section matches main:
- the per-call
max_tokens; - Pi's
supportsReasoningEffort: False; - the 422 on a request
reasoningfield; - the default permission rules;
unknownfailures being retried;- TTL 16,200 ≥ 14,400 + 1,200;
- the
extra_bodyprecedence.
What we checked at 55ac9725c, against the benchmark-review and agent-review checklists:
- All 12 presets resolve with the intended wiring:
single_agent_turn_legacytoopencode_agent/pi_agent, no relay and no leftover instance. The*_legacy_agentpresets are unchanged apart from their headers. gym env validatepasses on the 9 presets tried. The composition withsandbox_docker_local.yamlbehaves as documented.test_hle_diamond.py, thebenchmarks/hletests and the two tooling tests pass.- No references to the old preset names remain in the repo,
fern/included.
No blockers. One ask about smoke evidence and a few doc and test notes are inline.
| hle_diamond_opencode_agent: | ||
| responses_api_agents: | ||
| opencode_sandboxed_agent: | ||
| opencode_agent: |
There was a problem hiding this comment.
benchmarks/hle_diamond/opencode_search.yaml:23
Risk (evidence): the smoke doesn't exercise what these presets commit.
The runs used python:3.11-slim-bookworm with network_access: inherit and synthetic rows. The composed profiles pin /usr/local/bin/opencode with its sha256, and the Pi runtime in /opt. A slim image has neither, so the smoke must have overridden or downloaded them, but the body doesn't say how.
Not yet exercised:
model_onlyandmodel_and_toolsegress on OpenSandbox;- the science and reference images;
- the Tavily MCP grant on this preset,
pi_searchandopencode_reference.
The hle-equality test covers most of the harness side, but the Tavily grant is new to these presets.
Could you:
- add the exact smoke overrides to the Validation section;
- run a few rows per harness on the science image with
model_only; - run one search preset with Tavily on
model_and_tools?
The real-subset comparison against the relay presets is fine as the follow-up you already list.
There was a problem hiding this comment.
Thanks, fair point.
- Smoke overrides: now listed in the Validation section. In short, the public image with
network_access: inherit. For OpenCode,sandbox_executable_pathandsandbox_executable_sha256are null, so the adapter installs 1.17.11 in the sandbox. For Pi,sandbox_runtime_diris null, so it installs Node and Pi. The pinned binary and runtime paths were therefore not run. The tests check them against the Dockerfile and package pins. - Tavily: ran
opencode_search,pi_searchandopencode_referenceat cd3a3f0, 2 search rows each. Each row made one Tavilyweb_searchcall through the agent'stool_serversgrant, rewards were 2/2 at 1.0, and there were no failures. These usedinherit, as feat(hle,apex_shortlist): run the OpenCode presets through opencode_agent sessions #5825/feat(hle,apex_shortlist): run the Pi presets through pi_agent sessions #5826 did. model_only/model_and_toolson the science image: not done. OpenSandbox does enforcemodel_onlyhere: an earlier probe on the public image could not resolvedeb.debian.orginside the sandbox. So a public image can't run under the presets' egress, because the harness install needs the network. The science and reference images aren't available to our sandbox provider. I've listed this in Known limits and in the comparison follow-up.
| adapter reuses, and Pi 0.85.1's `openai-completions` path; no Pi request has been captured yet). | ||
| The knob is the right value and takes effect once the adapter exposes the flag; | ||
| until then label Pi runs "effort not transmitted (adapter)". | ||
| `++hle_diamond_opencode_full_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. |
There was a problem hiding this comment.
benchmarks/hle_diamond/README.md:173
Note: this bullet also covers "the text *_legacy_agent presets on the same agent", but the override key names hle_diamond_opencode_full_agent, which exists only in the full presets. On opencode_legacy_agent, opencode_search_legacy_agent and opencode_reference_legacy_agent, that key adds an inert partial block, and the effort silently stays high. Could you give the per-preset instance names here (hle_diamond_opencode_agent, hle_diamond_opencode_reference_agent)?
Related: the full presets' agent instance is renamed from hle_diamond_opencode_agent (main) to hle_diamond_opencode_full_agent. Existing ++hle_diamond_opencode_agent... overrides on opencode_full therefore stop applying. Worth a line in the Compatibility "Preset names" bullet, next to the #5176 note.
There was a problem hiding this comment.
Good catch. The override now names each preset's instance: hle_diamond_opencode_full_agent, hle_diamond_opencode_reference_agent or hle_diamond_opencode_agent. It also says that any other name is silently inert. I resolved the override against all five OpenCode *_legacy_agent presets, and it reaches each one. I also added the full presets' instance rename to the Compatibility "Preset names" bullet.
| call, so the sandboxed presets' `remaining_context` policy, which left the cap to the model server, | ||
| has no equivalent in `opencode_agent`, and asking for the whole 262,144-token window makes vLLM | ||
| refuse the call. The Pi session presets keep `remaining_context`. | ||
| - The OpenCode session presets lose two settings of the sandboxed benchmark profile, the 400-step cap |
There was a problem hiding this comment.
benchmarks/hle_diamond/README.md:417
Note: "lose" reads as a harness limit, but main's opencode_agent accepts both agent.build.steps and compaction.auto in a session's opencode_config (responses_api_agents/opencode_agent/app.py:324-361). Dropping them is a choice of the shared offline_science profile, which this PR rightly keeps in lockstep with hle. Suggest saying the profile leaves them unset and how to restore them per run. Both can move scores, so restoring them in the profile (for hle, hle_diamond and apex_shortlist together) could be a follow-up.
There was a problem hiding this comment.
Agreed. The README now says the shared profile leaves the step cap and compaction.auto unset. It gives the per-run overrides (...opencode_config.compaction.auto=false, ...opencode_config.agent.build.steps=400), which I checked resolve and pass the session-config check. Restoring them in the profile for hle, hle_diamond and apex_shortlist is listed as a follow-up.
| # forward. Needs a vision-capable policy model. | ||
| # | ||
| # The agent has its own name so that sandbox_docker_local.yaml can override it and the session agent of | ||
| # opencode.yaml (hle_diamond_opencode_agent) separately. Same knobs as opencode.yaml: reasoning high, the |
There was a problem hiding this comment.
benchmarks/hle_diamond/opencode_full_legacy_agent.yaml:12
Note: opencode.yaml is now the session preset: no reasoning knob, the note goes in system_prompt, and the permission rules are different. So "Same knobs as opencode.yaml" no longer holds.
| # opencode.yaml (hle_diamond_opencode_agent) separately. Same knobs as opencode.yaml: reasoning high, the | |
| # opencode.yaml (hle_diamond_opencode_agent) separately. Same knobs as opencode_legacy_agent.yaml: reasoning high, the |
There was a problem hiding this comment.
Applied. opencode_search_full_legacy_agent.yaml had the same issue: it pointed at opencode_search.yaml, so it now names opencode_search_legacy_agent.yaml.
| relay is removed; each names the session preset that replaces it.""" | ||
|
|
||
| @pytest.mark.parametrize(("config_file", "session_file", "agent_name", "harness", "with_search"), LEGACY_PRESETS) | ||
| def test_legacy_presets_keep_the_relay_and_name_their_session_preset( |
There was a problem hiding this comment.
resources_servers/equivalence_llm_judge/tests/test_hle_diamond.py:810
Note (config tests): the team rule for presets is gym env validate plus real pairing runs, without unit tests that resolve the YAML and re-assert its values. Several new tests are of that kind:
- this one and
test_full_presets_are_deprecated_without_a_session_preset(:838): relay wiring,reasoningEffort == "high", header-comment text; test_full_presets_keep_the_sandboxed_agents_effort_knob(:661);- the literal checks in :685-709 (
timeout == 14400, note prefixes,network_accessper preset); - the profile literals at :656, :751, :779, :912, :929 and :1042.
These would break on any profile tweak without catching a bug.
Please keep the real invariants:
- hle-equality (:735);
- the schema validation (:713);
- the Dockerfile digest (:757) and
pi_version(:774); - TTL ≥ budget + ready wait (:710);
- the Docker-override refusal (:866);
- the restated-copy drift guards.
The others could go, or compare against the resolved profile value instead of a literal.
There was a problem hiding this comment.
Done in cd3a3f0: three tests removed, 9 cases in all (relay wiring and header text, the full presets' effort knob), plus the per-preset literals (timeout, notes, egress and tool servers, config_paths, sandbox_runtime_dir). The Docker-override checks now compare with the preset itself instead of literals. The invariants you listed stay.
I kept the deny-order assert at :656 and dropped only its *git clone* literal. It checks that task/webfetch/websearch come after "*": allow with no tools map ahead of them. That is the ordering bug that let webfetch and task through before #5387, so it guards behavior, not a value.
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
RISK — The shipped restricted and search configurations still need representative rollout evidence
The PR reports real-model smoke runs for the code-only agents, but those used synthetic questions, a public Python image, and unrestricted egress. It explicitly reports no session runs of the two search presets or the reference preset. That leaves the distinguishing paths described in the session configuration documentation unvalidated: the pinned science runtimes under restricted egress and the episode-scoped Tavily grants. The search and reference sections acknowledge those gaps. AGENTS.md requires representative real smoke rollouts for behavior-changing agent work.
Could you attach the following evidence before merging?
- Run both code-only session presets with their science images and
model_only. Show successful code execution and grading, blocked direct public egress, cleanup, and failed-rollout counts. - Run both search session presets and the reference preset with
model_and_tools. Show a successful Tavily call through each episode’s MCP grant, blocked direct public egress, grading, and cleanup. - Compare the relay and session paths on the same small real text subset. Report rewards, graded and failed counts, and denominator changes. Explain intentional differences rather than requiring equal scores.
Keep unrestricted Docker pilots labeled as comparison infrastructure; they don’t validate the restricted benchmark configurations. These are requested acceptance checks, not executions performed during this review.
I inspected all 20 changed paths and their affected contracts. I independently completed the session-runtime topic because its child advisory wasn’t available. This was a read-only review: I didn’t execute tests or reproduce the reported smoke runs.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| adapter reuses, and Pi 0.85.1's `openai-completions` path; no Pi request has been captured yet). | ||
| The knob is the right value and takes effect once the adapter exposes the flag; | ||
| until then label Pi runs "effort not transmitted (adapter)". | ||
| `++hle_diamond_opencode_full_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. |
There was a problem hiding this comment.
RISK — Use the routed agent’s name in each relay effort override.
This bullet covers the full and text relay presets, but its only override targets hle_diamond_opencode_full_agent. Applying it with low to hle_diamond/opencode_legacy_agent leaves the actual agent at high: the text preset uses hle_diamond_opencode_agent, and the reference relay preset uses hle_diamond_opencode_reference_agent. The wrong override adds a partial block without an entrypoint, which server detection ignores, so the run can be mislabeled instead of failing clearly.
Could you replace the single override example with:
| `++hle_diamond_opencode_full_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. | |
| Override per run using the target for the selected relay preset: | |
| - Full/full-search: `++hle_diamond_opencode_full_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. | |
| - Text/text-search: `++hle_diamond_opencode_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. | |
| - Reference: `++hle_diamond_opencode_reference_agent.responses_api_agents.opencode_sandboxed_agent.opencode_config.provider.nemo_gym.models.dummy_model.options.reasoningEffort=<level>`. |
Replace the preceding “Override per run with” line too. Retain the renamed full-agent target and keep the session presets’ model-server instructions separate.
Proposed regression check: compose each of the five OpenCode relay variants with its documented override set to low; assert that the routed agent has reasoningEffort == "low", no extraneous agent block appears, and its dataset, tools, image, and network policy are unchanged. This is source reasoning, not an executed test; verify the suggested text before adopting it.
| produced, as in `benchmarks/hle`. A harness crash (a nonzero exit, no result) is retried and then | ||
| reported as a failed rollout, so it leaves the denominator; the relay presets' | ||
| `execution_failure_reward_zero` scored it 0. Both agents report such a crash as failure kind | ||
| `unknown`, which the Environment Server's `agent_outcome_policy` retries by default. Setting |
There was a problem hiding this comment.
RISK — Remove the ineffective crash-grading workaround.
The documented agent_outcome_policy.by_failure_kind.unknown: verify override doesn’t grade the harness crashes described here. For a nonzero harness exit, OpenCode raises HTTP 502, and Pi raises RuntimeError. The Environment Server converts that failed request into a dependency failure; it never receives a response to which the outcome policy can apply. An operator following this advice still loses the crashed rollout from the denominator.
Could you replace the explanation and workaround at lines 423–428 with:
| `unknown`, which the Environment Server's `agent_outcome_policy` retries by default. Setting | |
| Harness crashes escape the agent route as errors, so the Environment Server handles them as | |
| dependency failures before `agent_outcome_policy` runs. Setting `unknown: verify` therefore | |
| cannot make these crashes gradable. Keep crash grading separate from infrastructure-failure | |
| handling, and report the failed-rollout count next to every score. |
Preserve the preceding distinction that output/context/time-limit results are graded. Also distinguish crashes from an actual failed response carrying ng_agent_outcome: the latter does reach the outcome policy.
Static acceptance: trace a nonzero exit through each linked branch and confirm that the documentation no longer promises an unknown override can invoke verification. Retain the separate behavior for returned failed responses and gradable limit results. No runtime-policy change is proposed, and I didn’t execute these cases.
| - A session's sandbox is created at seed, before the agent's own concurrency limit (`concurrency: | ||
| 512`) applies. `pi_agent` waits for a slot only when the activation starts, outside the run | ||
| budget, while the sandbox idles and its TTL runs, so a long wait can use up the 1,800 s of TTL | ||
| headroom and lose the sandbox before the deadline. `opencode_agent` counts the wait against the |
There was a problem hiding this comment.
NOTE — Suggestion: describe OpenCode’s first-activation queue wait accurately.
For the ordinary session path used here, the caller supplies no deadline, and OpenCode acquires its semaphore before starting the run budget. Its sandbox can therefore consume TTL headroom while waiting outside that budget, just like Pi’s; the claimed protection for OpenCode isn’t present.
Could you replace the OpenCode distinction with: “Both agents wait for an activation slot outside the first run’s budget, while their seeded sandboxes idle and their TTLs run”? Retain the concurrency ceiling and sandbox-expiry warning. No runtime change is needed.
Static acceptance: the paragraph should match the ordinary first-activation ordering above without implying that a continuation receives a fresh deadline. This is a documentation correction based on source inspection, not an observed timeout.
…rding, config tests - README: the OpenCode relay presets' effort override names each preset's agent instance (hle_diamond_opencode_full_agent, hle_diamond_opencode_reference_agent, hle_diamond_opencode_agent); under any other name the override adds an unused agent block and the effort stays high. - README: the step cap and compaction setting are left unset by the shared offline_science profile, not missing from opencode_agent; give the per-run overrides that restore them. - Headers of the full relay presets name opencode_legacy_agent.yaml and opencode_search_legacy_agent.yaml, whose settings they share, instead of the session presets. - test_hle_diamond.py: drop the tests and asserts that restate preset values (relay wiring, header text, the full presets' effort knob, timeout, notes, egress and tool servers per preset, config_paths, sandbox_runtime_dir) and compare the Docker override's kept settings with the preset itself instead of literals. The routing, schema, hle-equality, image-pin, TTL, deny-order, Docker-override refusal and drift checks stay. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test cd3a3f0 |
A harness crash reaches the Environment Server as a failed agent call, which it turns into a dependency failure before agent_outcome_policy runs, so no by_failure_kind setting can grade it; drop the `unknown: verify` workaround. OpenCode, like Pi, starts a first activation's budget only once it holds a slot, so its queue wait also runs outside the budget while the sandbox idles. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
| @@ -1,12 +1,17 @@ | |||
| # OpenCode sandboxed preset on the 728 text-only HLE-Diamond questions, mirroring benchmarks/hle/opencode_legacy_agent.yaml. | |||
There was a problem hiding this comment.
get the name back - opencode_full.yaml
| user message the harness forwards) and written to | ||
| ``benchmarks/hle_diamond/data/hle_diamond_benchmark_opencode_full.jsonl`` for | ||
| ``opencode_full.yaml`` and ``opencode_search_full.yaml``. | ||
| ``opencode_full_legacy_agent.yaml`` and ``opencode_search_full_legacy_agent.yaml``. |
There was a problem hiding this comment.
prepare_opencode_legacy.py
| @@ -25,8 +25,8 @@ | |||
| questions without an image as raw fields to be templated at rollout time via | |||
There was a problem hiding this comment.
which script use for new yaml?
…t prepare script legacy Review: opencode_full.yaml and opencode_search_full.yaml keep their names (they still run opencode_sandboxed_agent behind the relay); only their agent instance stays renamed. prepare_opencode.py becomes prepare_opencode_legacy.py, since only those two relay presets use it. The prepare.py and prepare_text.py docstrings now say the session presets use prepare_text.py, and the README names the two full presets wherever it describes the relay presets. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test 372003e |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43504581611 |
The upstream web tools preset extended opencode_legacy_agent.yaml and so ran opencode_sandboxed_agent behind the deprecated legacy_agent relay, the one text preset left on it after #5702 moved the others to agent sessions. It now extends opencode.yaml and overrides the opencode_agent instance the way opencode_search.yaml does for Tavily: - absolute_ip_server_types adds resources_servers, since the sandbox reaches the hle_tools server's MCP endpoint by address. - The environment note moves from the sandbox file /tmp/nemo-gym-environment.txt to the agent's system_prompt, and mcp_tool_timeout_seconds is 300 for a web_fetch of a long page or PDF. - The opencode_config reasoningEffort block goes: a session's opencode_config takes no model options, and the effort travels on the policy model server's extra_body like the other session presets. - tool_servers ([hle_tools]) and network_access (model_and_tools) stay; SingleAgentTurnEnvironmentServer reads the grant from the bound agent and requires expose_tools_over_mcp, which the server instance sets. sandbox_docker_local.yaml composes with the preset again (the override's hle_diamond_opencode_agent block targets opencode_agent); its note names no search backend now, since it serves the Tavily and the upstream web tools preset alike. Tests: the preset leaves LEGACY_PRESETS and joins the agent-session, reasoning-effort and local-Docker parametrisations; the config test asserts the session wiring and holds the agent equal to opencode_search.yaml's apart from tool_servers and system_prompt. No server code changes. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]>
…eset (NVIDIA-NeMo#5176) * feat(hle_web_tools): upstream HLE web_search and web_fetch behind the blocklist over MCP Add resources_servers/hle_web_tools, a tool server that implements section 3 of centerforaisafety/hle docs/evaluation-with-tools.md (commit 22ed307): exactly two MCP tools, web_search (at most 20 results) and web_fetch (Markdown capped at 60,000 characters with a truncation indicator, no media payloads), with Tavily as the search and extraction backend and the keys held server-side. The pinned upstream docs/blocklist.json is shipped byte-exact and digest-checked at start; all seven rule families are enforced with the protocol's semantics, plus query refusal for blocked site: domains and verbatim question spans (8 consecutive words, configurable; the question arrives through /seed_session), fetch-URL checks after percent-decoding archive and proxy wrappers, title-and-Markdown re-checks of fetched and cached pages, and a log line per blocked call naming the family and rule. Add benchmarks/hle_diamond/opencode_hle_tools.yaml, the OpenCode preset with this server as its only tool server, document it and the residual Tavily-backend difference in the Diamond README, and extend the Diamond preset tests to it. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(hle_web_tools): refuse web_search from a session with no seeded question The plain POST /web_search route stays served next to /mcp under Gym's MCP exposure, and a call without the rollout's cookie or token lands in a fresh session that carries no question, so the verbatim-span rule was silently skipped (probe: the same 8-word query refused with the rollout cookie, served with no cookie and no token). Fail closed instead: web_search refuses any session that was not seeded with a question under the new require_seeded_question flag (default on), logged as family=unseeded_session; a seed without a question says its searches will be refused. The other families already applied on the direct route, and web_fetch has no session-dependent rule. Add the model-free test (seed, then a cookie-less POST /web_search is refused and the backend is never called; the flag off restores the old behaviour), and reword the module docstring and both READMEs to describe the enforced behaviour rather than claiming the agent reaches the server only over MCP. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): refuse re-seeding a seeded session with another question A session now keeps the question it was seeded with: a retried seed with the same words is served again, a seed that would change or drop the question answers HTTP 409 (ResourcesSessionConflictError), so a caller holding a session cannot swap the verbatim-span check out from under it. QuestionSpans keeps a SHA-256 of the normalized words, never the text, to tell the two apart. This does not close the fresh-session path: /seed_session is unauthenticated and network_access model_and_tools admits the whole tool-server host, so a sandbox can seed a new session with a question of its choice and search from it without the span rule. The server README and the opencode_reference.yaml header now state that residual and what closing it needs (an authenticated seed channel the sandbox never sees). Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> (cherry picked from commit 27187af4bc522d498ca64039b14570f41434aae2) * fix(hle_web_tools): import nemo_gym names from their new paths main moved the modules this server imported (nemo_gym.base_resources_server, nemo_gym.server_utils names, nemo_gym.mcp_auto_exposure) and serves the old paths only through deprecation shims removed in nemo_gym 0.10.0. Rewritten with scripts/migrate_imports.py to the public API (nemo_gym.client, nemo_gym.server_runtime) and, for the MCP test, the defining module, as the other servers on main do; the README names the new request path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * docs(hle_diamond): say hle_web_tools exists as its own preset opencode_reference.yaml and the README's Reference preset section, both from main (#5177), said the reference preset would switch to the hle_web_tools server once it existed. This branch adds that server, so the sentence would turn into an unfulfilled promise on merge. The reference preset keeps the Tavily tools here; the wording now names opencode_hle_tools as the preset that runs hle_web_tools (on the science image) and leaves running it on the reference image and egress policy to a follow-up change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): end the Tavily call when every key is rejected A key pool whose keys Tavily all rejects (401, 432, 433) spun forever in the key-selection loop without an await, freezing the worker's event loop: one configured key, a key listed twice, or two distinct rejected keys were enough. A rejected key also spent the transient retry budget, so [bad, bad, bad, good] with three attempts never reached the good key. The pool is now deduplicated when the backend is built, rejected keys move on without spending an attempt, the next key comes from a bounded helper over the keys still accepted, and the call raises a RuntimeError naming the status once every key is rejected. Transient failures keep their backoff and budget. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): turn malformed Tavily bodies into tool errors web_search read Tavily's payload unguarded: a body that is not an object, `results: null`, a non-object item or a non-string title or content raised AttributeError or TypeError and reached the model as an HTTP 500. web_fetch had the same `results: null` gap and rendered a non-string raw_content as page text. Both tools now read the results list through one guarded helper. web_search answers a malformed body with a "Search failed" tool error, skips non-object items and treats non-string title and content as empty; web_fetch reports any malformed body, item or raw_content as "Fetch failed", and guards failed_results the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): add the example data CI validates CI's changed-server step runs ng_test with should_validate_data=true, which requires data/example.jsonl (5 rows), data/example_metrics.json and data/example_rollouts.jsonl, plus an agent with an example dataset in the server config; hle_web_tools had none of them. Following resources_servers/tavily_search: the config gains a simple_agent with an example dataset behind a single_agent_turn_legacy environment server over direct HTTP, example.jsonl holds 5 synthetic general-knowledge rows (no HLE text, each marked by a placeholder field) whose tools are web_search and web_fetch with the server's own schemas, example_metrics.json comes from gym dataset collate in example_validation mode, and example_rollouts.jsonl holds placeholder rows since no live model or Tavily call was made. The server stays verified: false. The README says so, and the update-readme-table hook adds the server to the environment list now that its config has an agent. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * docs(hle_web_tools): say the server must run single-worker Seeded questions and the page cache are per process, so with num_workers > 1 a rollout's seed and its searches could land in different workers; the module also defines no worker app, so such a launch fails to start. Rather than add the multi-worker entrypoint footer, the README states the single-worker requirement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): refuse URL spellings the policy could misread The URL check certified URLs it had not fully checked and matched the page-level families on the raw string only. Now url_block: - refuses as malformed_url any URL longer than 4,096 characters, with a backslash, whitespace or control character, or with any @ in the authority (an empty https://@host included); - fails closed when candidate expansion stops with candidates unexplored, at the 64-candidate cap or after the original plus four rounds, so 63 decoy query values or a fourth decoded form no longer hide a target; - runs url_prefixes and serp_url_patterns on a canonical form as well (IDNA lower-cased host, trailing dot, userinfo and default port dropped, dot segments resolved), so :443, a trailing dot or /x/../ no longer evade a prefix; - treats every *.archive.org host as a wrapper and reads https:/, https:/// and https: remainders as https://; - reads wrapped and decoded URLs the way WHATWG fetchers do (backslash as /, tab and newlines deleted); - takes each embedded http(s):/ up to the next one instead of through a lookahead to the end of the string, so extraction is linear. site: operands are read as host characters only, so (site:a OR site:b), site:a|site:b and site:b, yield bare hosts, and an operand whose IDNA encoding fails is refused instead of skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): check the whole fetched page before it is cut Fetched content was sanitized and cut at max_cached_page_chars before the content families ran, so a blocked span past 500,000 characters was served and cached, and a cache cap below max_fetch_chars served a cut page as truncated=False. Now: - a fresh page is checked against url_patterns and patterns_case_sensitive on the provider's raw Markdown, before data URIs are removed or anything is cut, and on the sanitized Markdown; a refused page is never cached; - the scan is bounded: a page longer than max_page_chars (new, default 1,000,000) is refused unread as oversized_page, and the regex work runs in a worker thread instead of on the event loop; - max_cached_page_chars no longer cuts the page: a longer page is served whole but not cached, so cache-hit rechecks see the complete sanitized Markdown; - data URIs with media-type parameters or a percent-encoded payload are removed too, the payload stops at the Markdown destination's end so following prose is kept, and every repetition is bounded so the regex stays linear (the unbounded suggested form is quadratic); - the heading fallback for the title is linear on long blank runs (100,000 characters took 42 s) and drops a closing # sequence. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): bind typed sessions to their episode and fence closes A typed seed (an Environment Server's resources_session_id, episode_id, task_id and task_data) kept only the question, so the same ID could be seeded or closed for another episode or task, and a seed replayed after a close recreated a searchable session. Typed seeds are now validated as ResourcesSeedSessionRequest, their episode and task are recorded next to the question, and seed and close go through ResourcesSessionFence, as in example_single_tool_call: a conflicting seed or close answers 409, and a seed after its session closed is refused for the retry window. The identity map shares the 10,000-session cap with the questions and is evicted with them. Legacy Agent seeds are unchanged. The test runs check_resources_session_contract with keeps_state=True. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): treat a question with no words as no question A seed whose question has no word characters ("?!", or an empty user message) was stored as seeded with span_words=0, which disabled the verbatim-span rule while require_seeded_question still saw a seeded session. extract_question now returns None for such text (the question field falls back to the last user message first), so the session stays unseeded and its searches fail closed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): log a warning when the session cap forgets a question Past MAX_SESSION_QUESTIONS (10,000) seeded sessions the least recently seeded one was dropped silently, and its later searches were refused as unseeded_session with nothing pointing at the cause. The eviction now logs a WARNING naming the session and the cap. The test lowers the cap to one and also checks that the question and the episode binding leave together. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * docs(hle_web_tools): record the MIT license of the vendored blocklist blocklist.json is an unmodified copy of docs/blocklist.json from centerforaisafety/hle at 22ed3074b1e7b134bcbc09028d0ba320839b0655, which is MIT (Copyright (c) 2025 centerforaisafety). The JSON stays byte-exact for its digest check, so the upstream LICENSE at that revision is reproduced unchanged in the sibling LICENSE-HLE, the file gets a row and a note under Vendored Components in ATTRIBUTIONS.md, and the server README gains a Licensing section. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * docs(hle_diamond): name the sandbox-seeded session residual Both READMEs called the Tavily backend the one residual difference from upstream's wrapper, and the Diamond section said a session not seeded with the question is refused "so the span rule cannot be skipped". Both overstate the policy: /seed_session is unauthenticated, so a sandbox process can seed a fresh session with a question of its choice and search from it; the 409 on re-seeding covers existing sessions only, and the session and MCP-token signing key derives from public config. The server README now names that residual in its own paragraph, the Diamond section lists it next to the backend as the second residual, the fail-closed sentences are scoped to unseeded sessions, and the server README's dangling pointer to the Diamond "Reference preset" section now points at "Upstream web tools", where the residual is listed. Closing it needs an authenticated seed channel; both READMEs carry the marker TRACKING_ISSUE_TBD for the tracking issue, to be replaced by its number before push. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rima Shahbazyan <[email protected]> * fix(hle_web_tools): declare the task-data schema CI validates The core unit tests require every resources server to ship a task_data.py, and the committed example rows to validate against it. hle_web_tools had none, so TestSchemaPresence and TestRepoDataMatchesSchemas failed. Declare both keys the example rows carry: the optional question that /seed_session reads, and the placeholder note that marks the rows as synthetic. Keeping the note in the data makes each row say what it is; the schema records that the server never reads it. tests/unit_tests/test_task_data.py: 2 failed, 421 passed before; 425 passed after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): map hosts the way UTS #46 fetchers do normalize_hostname used Python's IDNA 2003 codec, which leaves code points unassigned in Unicode 3.2 unmapped. Browsers (WHATWG URL) and yarl, which aiohttp uses, map a host with UTS #46 first, so https://sc\U0001f130le.com/leaderboard was allowed by the policy but fetched as scale.com. The same held for lastexam.ai and arxiv.org spelled with such letters. Map a non-ASCII host with idna.uts46_remap (non-transitional, no STD3 rules) before the existing encode, and declare idna, already installed through aiohttp and yarl, as a direct requirement. IDN hosts that are ordinary (例え.jp) keep their punycode form. Test: one row in the URL refusal table; it fails before this change (allowed, extract awaited) and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): refuse a wrapped URL Python cannot parse url_shape_problem refuses an unparseable URL only at the outer level. For a wrapped or decoded candidate, _single_url_block returned None when urlsplit or IDNA raised, which skipped every family for it. Python rejects https://[::1]@scale.com/leaderboard ("'scale.com' does not appear to be an IPv4 or IPv6 address"), while browsers, httpx and urllib3 read it as host scale.com, so a redirector carrying it in ?u= was served. Refuse such a candidate as malformed_url instead. The realistic URL list from review (48 URLs) shows no new refusal. Test: one row in the URL refusal table; fails before (served), passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): read a wrapper's remainder as a URL however it is spelled A scheme-less remainder became a candidate only when it matched an ASCII-only host regex, which rejects a trailing dot after the TLD, userinfo and full-width or ideographic-dot hosts. So web.archive.org/web/2024/scale.com./leaderboard and web.archive.org/web/2024/[email protected]/leaderboard were served, as was ?u=scale.com./leaderboard on a redirector. A wrapper fetches its remainder (and Google's cache its cache: target) whatever the spelling, so read each as https://<remainder> and let urlsplit and normalize_hostname decide the host. Other query values still need a scheme or a leading hostname, which may now end with a dot. The README also records the malformed_url refusal of an unparseable wrapped URL from the previous commit. Test: three rows in the URL refusal table; all three fail before (served) and pass after. The realistic URL list from review shows no new refusal. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): match url_prefixes with a query in any parameter order The eight openreview.net prefixes carry ?id=<paper>. As plain string prefixes they match one exact parameter order, so openreview.net/pdf?&id=46UGfq8kMI and openreview.net/pdf?x=1&id=... were served although a server reads both as pdf?id=46UGfq8kMI, and the id appears in no url_patterns rule. Keep the string-prefix check and add a second reading for a prefix with a query: its path must prefix the URL's path, and each of its key=value pairs must be among the URL's parsed query pairs (a value as a prefix), in any order. This only adds matches to the upstream semantics. Test: two rows in the URL refusal table; both fail before (served) and pass after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): collapse slash runs in the canonical URL form remove_dot_segments kept // runs, so arxiv.org//abs/2605.02442, arxiv.org/abs//2605.02442, arxiv.org/%2Fabs/... and the Wayback form of the first were served, and 2605.02442 has no url_patterns rule to catch them. Servers with nginx's default merge_slashes serve such paths as the single-slash page. Collapse runs of / in the canonical form. It is used for prefix and SERP matching only; the fetched URL is unchanged. Not changed: export.arxiv.org and /format/, /src/ and /e-print/ paths of 2605.02442 are gaps in the pinned upstream list, not in its matching. Test: one row in the URL refusal table; fails before, passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): fold Unicode presentation variants before query checks question_words ran \w+ over str.casefold() with no normalization, so a query that repeats 8 words of the question in full-width or mathematical letters, with a zero-width space or soft hyphen inside a word, with a combining accent, or joined by underscores was served. The query patterns had the same gap: humanity<U+00AD>s last exam was not matched. Search engines fold all of these back to the plain words. Words are now runs of letters and digits ([^\W_]+) after NFKC with format characters (Cf) removed and combining marks stripped; the question and the query go through the same function. url_patterns, patterns_case_sensitive and site: operands are checked on the query as written and as folded. Look-alike letters from another script (Cyrillic o) are still not folded; the README says so. Test: test_presentation_variants_of_a_blocked_query_are_refused, five rows, one per mechanism (NFKC, Cf, combining mark, underscore, a pattern with a soft hyphen); all five fail before and pass after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(hle_web_tools): apply ruff-format to the full-width span row The previous commit was made before ruff-format wrapped this row; no behavior change. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): bound title work and cap shown titles Result titles come from the provider with no length bound, and _TITLE_SEPARATOR_RE (\s+ before a separator) backtracked over every blank of a run, quadratic in its length: a 20,000-blank title took 3.9 s and a 50,000-blank one 26.6 s of web_search on the event loop. Each separator also added a variant up to the full title length, so a title of 'a | ' * 2,000 cost 1.1 s. Start the separator match only at the first blank of a run, and cut a title longer than 1,000 characters (with an ellipsis) before it is shown or checked against answer_title_patterns. url_patterns and patterns_case_sensitive still see a result's whole title, which is linear. The same cap applies to the fetched page's Title: line. That title, taken from the heading when the provider sends none, was not counted against max_fetch_chars, so one fetch could return about 960,000 characters. Tests: test_long_result_titles_are_checked_in_linear_time (a blank run and a separator chain, both 20,000 characters) fails before (about 5 s) and passes after; the 60,000-character cap test gains a heading-derived title case, which fails before (the 100,000-character title is shown whole) and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): answer a non-JSON 200 body as a tool error 5142f52df turned a decoded body of the wrong shape into a tool error, but a 200 whose body does not decode still escaped: a gateway's HTML page raised aiohttp's ContentTypeError and a cut-off JSON body raised JSONDecodeError, and both reached the caller as a server error. Return None from the transport for such a body, so the existing "Search failed: ... malformed response" and "Fetch failed for <url>" paths answer it. It is not retried: a 200 is not a transient status. Test: two rows (HTML body, cut-off JSON) in the parametrized malformed-payload test, through the real transport with a stubbed request; both fail before (the exception propagates) and pass after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(hle_web_tools): make the retry-budget test fail when a rejection spends it test_rejected_keys_do_not_spend_the_retry_budget only bounded the total number of requests, which the pre-fix code also met. Two real regressions survived it: a rejected key spending an attempt, and key selection that no longer wraps round to the current key. Replace it with the mixed case: keys key-one, key-two and two attempts; Tavily answers 401, 429, 200. The call must succeed after trying key-one, key-two, key-two with one backoff sleep. Fails on app.py from 498e34bc3 (before eb466ecb9: "Tavily HTTP 429 on /search after 2 attempts"), on the spend mutant (same error) and on the no-wrap mutant (TypeError); passes on HEAD. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): fence a typed session the cap forgets Untyped Agent seeds share the 10,000-session cap with typed sessions. When eviction dropped a live typed session's episode binding, a later seed of that ID for another episode returned 200 and bound it, where the resources-session contract requires 409; the session's question was already gone. When the cap forgets a typed session, mark its ID closed by its bound episode in the session fence. A later seed of the ID then gets 409, and a close from its own episode is still accepted. The README states that the cap must exceed the peak number of open rollouts. Test: test_sessions_past_the_cap_are_forgotten_with_a_warning now seeds the forgotten ID for another episode and expects 409; it fails before (DID NOT RAISE) and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(hle_web_tools): cover the live-session close conflict and the wordless fallback Three regressions survived the session tests: - a close naming another episode of a live typed session was not checked (the contract checks it only for a closed session), so disabling that 409 deleted the session's question unnoticed; - holds_state looked only at the question table, so a close that kept the episode binding passed; - the wordless-question row used the question field, which either of the two guards refuses alone, so dropping the extract_question gate for the last-user-message fallback passed. The contract test now counts the binding as held state and closes a live session with another episode (409, question and binding kept). The wordless case also seeds a last user message of "?!" with no question field. Fails on: the close-conflict mutant (200 != 409), the close-keeps-binding mutant ("close left state"), the gate mutant and app.py from 16cd8c0f5 (wordless message seeded); passes on HEAD. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): refuse a site: operand that is not hostname-shaped The README said a site: operand that is not a valid hostname is refused, but only an operand whose IDNA encoding failed was: site:huggingface.co! and site:exa_mple!.org reached Tavily. Results were still filtered by domain, so nothing leaked, but the refusal and its audit log line that the protocol asks for were missing. Drop trailing punctuation after normalize_hostname (site:huggingface.co! is huggingface.co, refused as domains), and refuse as malformed_url an operand that is then not labels of letters, digits, - and _, optionally after *. Test: two rows in the site-operand table; both fail before (served) and pass after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): strip data URIs that omit the media type RFC 2397 lets a data URI omit its media type (data:;base64,...), and _DATA_URI_RE required one, so such a payload was served whole. Make the media type optional. The README now states the bounds that already applied: at most 16 media-type parameters, and the payload ends at the first whitespace, quote, ) or >, so a base64 payload wrapped over several lines keeps its later lines. Test: a data:;base64, image in the existing data-URI test page; fails before (payload kept) and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): refuse a multi-worker launch with the standard hook c4262af29 documented that the server must run single-worker, but the server did not use SimpleServer.multiple_workers_unsupported_reason, so num_workers=2 passed refuse_unsupported_num_workers and dry runs, and failed only later as uvicorn's 'Attribute "app" not found'. Return the reason (seeded questions, session bindings and the page cache live in one process), so run_webserver refuses num_workers > 1 before uvicorn starts with "hle_tools needs num_workers=1: ...". The README sentence now says so. Test: test_a_launch_with_several_workers_is_refused fails before (DID NOT RAISE) and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): run page checks in worker processes 465d43de4 moved the page work to asyncio.to_thread, but Python's re keeps the GIL for a whole search() or sub() call, so the event loop still stopped for the length of one scan. The same commit widened the scan to the provider's raw page of up to 1,000,000 characters: with a stubbed page of 999,000 characters of 抱抱脸 a 1 ms heartbeat saw a 4.0 s gap (答案: 3.5 s), from the pinned upstream hugging-face/answer-key url_patterns pair. A cache hit rescans up to 500,000 characters the same way. Run build_page and the content families, fresh and on a cache hit, in a module-level ProcessPoolExecutor of two spawn workers; the final-URL check stays on the loop and runs first. The Blocklist is passed with each call (its patterns pickle as source and recompile from re's cache), so a policy changed after start still applies. A pool whose worker died is replaced on the next call. spawn needs the entrypoint to keep its __main__ guard, which app.py has; with app.py as __main__ the workers resolve the functions through __mp_main__ (checked with a copy of app.py run as a script). After: the same probe shows a 0.02 s maximum gap for both pages. The README claim about a worker thread is corrected. Test: test_page_checks_do_not_stall_the_event_loop (300,000 characters of 抱抱脸, heartbeat gap < 0.5 s) fails before (1.25 s gap) and passes after. The 100,000-character heading timing case now warms the pool first, so it does not time the start of the worker processes. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_diamond): list the oversized-page refusal as a third residual The Diamond README said two residual differences from upstream's wrapper remain (the Tavily backend and sandbox-seeded sessions). A third was not disclosed: the protocol caps web_fetch output at 60,000 characters with a truncation indicator, so upstream serves the start of any page, while this server checks the whole page and refuses one longer than max_page_chars (1,000,000 characters) as oversized_page. A clean 1,040,000-character page is refused here and would be served cut upstream; long PDFs reach that size. List it as the third residual a with-tools number should state, and point to it from the server README. Also qualify the server README's redirect claim: the final-URL check relies on Tavily reporting the post-redirect URL in results[].url, which is verified only against a stub, not the live API. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): read format characters both as removed and as a space 4abb964f4 removed format characters (Cf) before splitting a query into words. That catches sp<ZWSP>in, but it glued words joined by a word joiner or a zero-width space: how<U+2060>many<U+2060>odd... became one word and was served, although the span rule refused it before that commit. Whether a search engine drops such a character or splits words at it is not known. Read the text both ways: the question's n-grams come from both readings, a query is checked in both, and the query patterns and site: operands see the as-written, removed and space readings. Test: a word-joiner-separated row in test_presentation_variants_of_a_blocked_query_are_refused; it passes on 2500e8539, fails on 4abb964f4..77d3f0f5a, and passes after. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): import test helpers from their moved nemo_gym paths Main moved nemo_gym.server_utils to nemo_gym.server_runtime.base_server and nemo_gym.testing to nemo_gym.server_runtime.testing (both since 0.8.0, old paths removed in 0.10.0). The tests imported refuse_unsupported_num_workers and check_resources_session_contract through the old paths, so importing them raised the nemo_gym DeprecationWarning. Rewritten with scripts/migrate_imports.py, imports merged by ruff; the README's test description names the new module path. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): pass the core public-API and environment-resources tests Two core unit tests that arrived or changed with the origin/main merge (69c748d082) failed on this branch's files: - test_public_api_facades flagged tests/test_app.py importing maybe_auto_expose from nemo_gym.server_runtime.mcp_auto_exposure; it is exported from nemo_gym.server_runtime. - test_repository_step_environments_declare_their_resources (#5108) flagged hle_web_tools_environment_server, whose single_agent_turn_legacy block named no resources_server. It now names hle_web_tools, as the tavily_search configs do. Before: the two tests, 2 failed. After: tests/unit_tests/ test_public_api_facades.py and test_add_legacy_agent_environment_servers.py 917 passed; resources_servers/hle_web_tools/tests 95 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(hle_web_tools): pin key rotation after a 429 and the release of every response Review thread 4398612291 asked that a 429 followed by a 200 still moves to the next key with backoff, and that every response is released. Both hold, but no test pinned either: a mutant that retries the same key after a 429, and one that releases only 200 responses, each passed the whole Tavily transport selection (22 passed). test_rejected_key_fails_over_and_provider_bodies_stay_private now runs for 401 (no backoff) and 429 (one backoff of 1 s), and asserts that both responses are released. Before (HEAD test, -k 'key or tavily or retry or twenty or malformed'): norotate 22 passed; release_only_200 22 passed. After: norotate fails [429-backoff1]; release_only_200 fails [401-backoff0] and [429-backoff1]; unmutated code passes. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(hle_web_tools): refuse a typed re-seed of a live session for another task Review thread 4398612319 listed, as an acceptance check, that a typed seed of the same resources_session_id with a changed task gets 409. The server already refuses it, but neither check_resources_session_contract nor this file's test changed only the task, so a mutant that compares only the episode (bound[0] != identity[0]) passed the whole file. test_typed_sessions_follow_the_resources_session_contract now seeds the live session again with task_id 2 and asserts 409, with the session's question digest and binding unchanged. Before (HEAD test file): mutant episode_only, 95 passed. After: mutant episode_only fails this test; unmutated code, 96 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): read a Wayback path with no timestamp as naming its target Follow-up to review thread 4405604682 (Wayback spellings). The Wayback unwrapping took the first segment after /web/ as the timestamp, so web.archive.org/web/scale.com/leaderboard was read as https://leaderboard and web.archive.org/web/scale.com as https://web/scale.com, and both were fetched. archive.org redirects such a path to a snapshot of the target (web/scale.com/leaderboard answers 302 to /web/<timestamp>/https://scale.com/leaderboard). The first segment is now read both ways: as a timestamp, and as the start of the URL. A timestamped path keeps its existing reading, so every spelling refused before is still refused; the extra reading only adds a candidate. Before (HEAD app.py, new URL-table rows): web/scale.com/leaderboard and web/scale.com fail (allowed). After: both refused as domains; the timestamped, id_, 2024* and Wikipedia rows unchanged; 98 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): read typographic quotes around a site: operand like ASCII quotes Follow-up to review thread 4405604730 (site: operand parsing). Typographic quotes and guillemets were neither openers nor excluded from the operand, and NFKC does not fold them, so site:“scale.com” became the punycode host xn--scale-hw3b.xn--com-9o0a, which is hostname-shaped and matches no domain: the query was served with no refusal and no audit line. A trailing ” survived as well (site:scale.com” became scale.xn--com-9o0a), since trailing punctuation is stripped after IDNA encoding. The operand regex now treats ‘ ’ ‚ ‛ “ ” „ ‟ « » ‹ › like " and ': they may open the operand and end it. The opener run is now repeatable, so stacked openers (site:((scale.com)), site:«“scale.com”») no longer stop the match. Before (HEAD app.py, new rows): site:“scale.com”, site:scale.com” and site:((scale.com)) are served. After: each is refused as domains; site:example.org, site:“example.org” and site:en.wikipedia.org/wiki/Foo_(bar) are still served; 101 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): fold every default-ignorable character and read ZWSP as a word break Follow-up to review thread 4398612299 (span-rule folding, e075400a3c). Two spellings still got an 8-word question span or a blocked query past both readings of format characters: - Mixing a zero-width space between words with a soft hyphen inside one ("How<ZWSP>many ... no<SHY>nvanishing", "H<SHY>LE<ZWSP>leaderboard"): each reading treats every format character the same way, so each one breaks. Unicode word segmentation (UAX #29) splits at U+200B and ignores U+00AD, and reads both as [how, many, ..., nonvanishing]. - Hangul fillers (U+3164, U+115F, U+FFA0; default-ignorable, category Lo) inside a word ("no<HF>nvanishing", "Hum<HF>anity's Last Exam", "H<HF>LE leaderboard"): only category Cf was folded, and NFKC maps the filler to U+1160, still a letter. fold_text now treats every Default_Ignorable_Code_Point (ranges from DerivedCoreProperties, since unicodedata has no such property) like a format character, and the checks read text three ways: all removed, all as a space, and as word segmentation does (U+200B a space, the rest removed). The readings apply to the question n-grams, the query's words, and the query forms the text families and site: operands see. Before (HEAD app.py, new rows in the presentation-variant table): the four rows mixed-format-characters, mixed-format-pattern, hangul-filler and hangul-filler-pattern are served. After: each is refused with its family; 105 passed. Seeding a 2.24 MB non-ASCII question takes 1.6 s instead of 1.1 s (ASCII: 0.49 s, unchanged); unbounded seed size is already part of the unauthenticated-seed residual. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): also match the canonical form with slash runs merged before dots Follow-up to review thread 4405604669 (equivalent spellings, 25f0c7f83b). The canonical form resolved dot segments and then collapsed slash runs, so arxiv.org/abs/x//%2e%2e/2605.02442 became arxiv.org/abs/x/2605.02442 and was fetched. httpx and urllib3 send that path unchanged, and nginx with its default merge_slashes collapses the run first and then resolves the dots: a throwaway nginx 1.26.3 serves /abs/2605.02442 for it (whether arxiv's front end does the same is not verified). The URL-shaped families now see both orders: dots then slashes (as before) and slashes then dots (nginx). Before (HEAD app.py, new URL-table row): arxiv.org/abs/x//%2e%2e/2605.02442 is allowed. After: refused as url_prefixes; arxiv.org/abs/x/2605.02442 and example.org/a//../b stay allowed; 106 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): find a title's site-name separator after a long blank run Follow-up to review thread 4405604713 (e10df7a73e capped shown titles). The answer-title check ran on the title already cut at 1,000 characters, so a result titled "Quiz answers" + 5,000 blanks + "| Site" lost its separator to the cut and was kept, although the model is shown "Quiz answers ...". Before the cap it was dropped. title_variants now takes the whole title: the title as shown, plus the title up to each separator that starts within the first 1,000 characters, however long the separator's blank run. Each variant stays at most 1,000 characters, so the check stays linear (1,000,000-character titles: under 0.04 s). An answer phrase that lies wholly past the cut is neither shown nor checked; the README says so. Before (HEAD app.py, new row padded-separator): kept. After: dropped; 107 passed. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): state when the session cap forgets a running rollout Review threads 4398612339 (LRU eviction) and 5680046430 (HOLD summary). The README said the cap "must exceed the peak number of rollouts open at once". That holds only for a harness that closes its sessions: OpenCode seeds with its run body and never closes, so held sessions add up, and a running rollout's question is forgotten once more than 10,000 later seeds reach the server, however few rollouts are open at once (probe with the cap at 2: A forgotten after B and C seed, with at most 2 open). The README also said a seeded session keeps its question "for its whole life", but only typed seeds check the fence: a forgotten Agent (untyped) session, or a closed typed ID, takes a later untyped seed through its cookie with another question (HTTP 200). The README and the comment in _install_question now say so, and that this, like an unauthenticated seed flood past the cap that makes other rollouts' searches fail closed, is the same unauthenticated-seed residual as a sandbox-seeded fresh session. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): state every bound of the data-URI regex Review thread 4398612357 (data URIs). The README named the 16-parameter bound only, but the regex also caps the type and subtype at 127 characters, each parameter name at 127 and each value at 256: a data URI with one parameter value of 257 characters is not matched and is served whole. The bounds are what keep the scan linear, so the code is unchanged; the README and the regex comment now state them and that a URI past them is left in place. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): state the page-check pool's cost and what still runs on the loop The README described the page-check pool (b132980c82) without its cost or its scope. Measured at this head, with the Tavily transport stubbed: - The pool is created on the first page check and starts workers on demand, up to two. Each worker imports the server module afresh and sits at about 240 MB RSS, the size of the server process, and the first fetch takes about 1.8 s against 0.002 s afterwards. - web_search's per-result URL, title and snippet checks still run on the event loop: one result whose title (or snippet) is 1,000,000 characters of 抱抱脸 holds the loop 4.2-4.4 s. Whether Tavily ever returns a title or snippet that long is not verified. Both are now stated next to the pool description; the code is unchanged. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): correct the configuration and preset notes - The configuration table omitted tavily_base_url, the one config field it did not list. - The quoted multi-worker refusal hard-coded hle_tools, the Diamond preset's instance name; refuse_unsupported_num_workers prints the instance's own name (hle_web_tools for configs/hle_web_tools.yaml). - "The checks below need TAVILY_API_KEY" pointed at Example data and Tests, which are model-free and pass with the key unset; the key is needed for live runs of the preset. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_diamond): name cap-forgotten sessions in the sandbox-seeded residual The Diamond README's residual said the 409 on re-seeding does not cover a new session. It does not cover a session the server's cap has forgotten either: an untyped seed through that session's cookie installs another question (HTTP 200). The server README says so since 0cd8d9c4e; this keeps the two residual descriptions consistent. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): use the split session locks and fences from main Main's #5083 split ResourcesSessionFence into ResourcesSessionLocks, which runs a session's seed and close one at a time, and ResourcesSessionFences, which refuses a seed after its close until the close retry window ends. The old name no longer exists, so the server failed to import after the merge. Map each call onto the new API without changing behaviour: locked() on the locks, and raise_if_fenced(), get() and fence() on the fences in place of raise_if_closed(), closed_episode() and mark_closed(). The base config already requires a positive close retry window, so the new constructor's check adds no refusal. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * build(hle_web_tools): declare dependencies in pyproject.toml and uv.lock Main's #4837 moved every component from requirements.txt to a committed uv project and lock, and its component dependency tests now refuse a server that still ships requirements.txt or lacks either file. Move the server's two requirements, nemo-gym[dev] and idna>=3.7, into a pyproject.toml that copies the shared resolver policy, as scripts/component_locks.py expects. The lock was seeded from the calendar server's lock, which has the same Gym dependencies, so it pins the same versions as the other component locks (idna 3.10, mcp 1.29.0) instead of a fresh resolve that would move mcp, fastapi and others to new major or minor releases. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): read a Wayback timestamp segment as a timestamp only Since the timestamp-less Wayback reading was added, every /web/<first>/... path was read both ways, so an ordinary timestamped snapshot also yielded the candidate https://<timestamp>/<url>, which names no page. Each Wayback layer then cost one to three extra candidates and more decode rounds, and a URL at the edge of MAX_URL_CANDIDATES or MAX_URL_DECODE_ROUNDS was refused as malformed_url where it was served before (four timestamped layers around a percent-encoded page, or a snapshot of a page with thirty URL-valued query values). Add the second reading only when the first segment is not timestamp-shaped (digits with an optional two-letter modifier such as id_ and an optional star, or a bare star), which no hostname is. /web/scale.com/x, /web/2024/..., /web/2024id_/... and /web/*/... keep their readings. Candidate counts return to what they were before the second reading existed: two for a plain timestamped snapshot. A URL-table row pins the four-layer case as served. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): protect a short question whole in every ignorable reading QuestionSpans took its span length from the "removed" reading of the question but built n-grams of that length from the "space" and "word_break" readings too. A question under the threshold whose ignorable characters (a variation selector, a zero-width space, a Hangul filler) sit inside a word has more words in the "space" reading than in the "removed" one, so fragments of a single word became blocked n-grams and a query that merely contained such a fragment as a word of its own was refused, against the README's "protected as a whole". No local HLE-Diamond question has fewer than 8 words or readings that differ, so this is a correctness note. Give each reading its own span length min(threshold, words in that reading) and check the distinct lengths longest first, returning the matched length so the refusal rule and the log name the span that actually matched rather than the "removed" reading's length. A test seeds a one-word question with an ignorable character inside the word in two spellings, serves a query repeating one fragment, and refuses the whole question in each spelling with the matched length in the log. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(hle_web_tools): check the shown title text at the cut title_variants tried the capped title (with its cut marker) and the title before each separator that starts within the first MAX_TITLE_CHARS characters. A separator starting exactly at the cut was excluded, and the cut marker made the end-anchored answer_title_patterns miss a phrase that ends exactly there, so a title whose text before " | Site" is exactly 1,000 characters and ends in "Quiz answers" was kept and rendered as shown, while the same title one character shorter was dropped. Add the shown text without its cut marker as a variant whenever the title is capped, so the check covers exactly what the model sees. Every variant stays at most MAX_TITLE_CHARS long, so the linear bound holds. A row in the title table pins the separator-at-cut case as dropped. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): count the later sessions that evict a rollout exactly The eviction loop pops the oldest session as soon as the table holds MAX_SESSION_QUESTIONS + 1 entries, so a running rollout's question is gone when the 10,000th later session is seeded, not after "more than 10,000 later seeds". A retried seed of a held session only moves it to the end, so the count is of distinct later sessions, not of seed requests. The log line ("more than %d seeded sessions are held") was already right. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): describe the word-break reading as the server's own The README and the app comment attributed the third ignorable reading to UAX #29 word segmentation in a sentence that names Hangul fillers among the characters it removes. UAX #29 classes U+3164, U+FFA0, U+115F and U+1160 as ALetter, letters it keeps; only format and extend characters are skipped by WB4, and U+200B is a break. Say what the reading does and where it follows the standard, and that the fillers are dropped because NFKC_Casefold drops them. The range list is introduced as including points outside category Cf rather than lying outside it, since most of the listed ranges are Cf, and as listed with adjacent ranges merged. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(hle_web_tools): say why the stray-closer row exists, drop a duplicate row The site:scale.com” row is the only one that catches an implementation reading typographic quotes as a balanced pair only, so it stays, with a comment saying what it pins. The hangul-filler-pattern row never failed without hangul-filler (the set membership) or soft-hyphen-pattern (the pattern path's folding) failing too, since both paths call the same fold_text and text_block folds nothing itself, so it is dropped. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(hle_web_tools): use main's session terms and name the retire release path main's AGENTS.md (since #5083) asks session code, tests and docs to use the names in the key-terminology glossary and add no synonyms. The glossary retires "typed session", "typed seed" and "Environment Server session" for "episode session" and "episode seed", "untyped seed" for "agent-run seed", "retry window" for "close retry window", and "free" for "release". This branch kept the old names in comments, the 422 detail for a malformed episode seed, a test name and fixture ID, docstrings and the README; the merge adapted the code to the split locks and fences but not the words. Rename them throughout. The README also said only a /close_session frees a slot before the cap evicts it: the checkpoint controller's retire of an attempt (retire_session_state) releases every session that attempt seeded too, whatever seed created it, and does not fence the ID, so say so. The "" fixture is test data about data URIs and stays. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(hle_web_tools): wrap the nested Wayback fixture to the line limit Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(hle_web_tools): link the seed-channel residual to its tracking issue The unauthenticated /seed_session residual is now tracked in NVIDIA-NeMo/Gym#5845. Both READMEs point at it in place of the TRACKING_ISSUE_TBD placeholder. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(hle_web_tools): give the true reason the server refuses several workers The README and multiple_workers_unsupported_reason said a rollout's seed and its searches could reach different workers. Session routing (since #3905, and restated by #5709 in the add-benchmark skill) pins a resources request by its cookie session_id and an MCP call by its token sid to the owning worker, so session-ID-keyed state is not what stops a multi-worker launch. What does: app.py defines no module-level app for uvicorn workers to import, and the URL-keyed page cache and the page-check pool are per process. Reword both and make the refusal test assert the new reason and the absence of the old one. Behaviour is unchanged: num_workers > 1 is still refused before uvicorn starts. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(hle_web_tools): refresh uv.lock for main's openai 2.45.0 pin After merging origin/main, scripts/component_locks.py --jobs 8 reported "FAIL resources_servers/hle_web_tools: The lockfile at uv.lock needs to be updated" and ng_test failed at uv sync --locked for the same reason, because main's root pyproject moved openai from 2.44.0 to 2.45.0 (#5464). Regenerated with uv lock --project resources_servers/hle_web_tools; the only change is openai 2.44.0 -> 2.45.0. component_locks now passes 286/286. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> * feat(hle_diamond): run opencode_hle_tools as an opencode_agent session The upstream web tools preset extended opencode_legacy_agent.yaml and so ran opencode_sandboxed_agent behind the deprecated legacy_agent relay, the one text preset left on it after #5702 moved the others to agent sessions. It now extends opencode.yaml and overrides the opencode_agent instance the way opencode_search.yaml does for Tavily: - absolute_ip_server_types adds resources_servers, since the sandbox reaches the hle_tools server's MCP endpoint by address. - The environment note moves from the sandbox file /tmp/nemo-gym-environment.txt to the agent's system_prompt, and mcp_tool_timeout_seconds is 300 for a web_fetch of a long page or PDF. - The opencode_config reasoningEffort block goes: a session's opencode_config takes no model options, and the effort travels on the policy model server's extra_body like the other session presets. - tool_servers ([hle_tools]) and network_access (model_and_tools) stay; SingleAgentTurnEnvironmentServer reads the grant from the bound agent and requires expose_tools_over_mcp, which the server instance sets. sandbox_docker_local.yaml composes with the preset again (the override's hle_diamond_opencode_agent block targets opencode_agent); its note names no search backend now, since it serves the Tavily and the upstream web tools preset alike. Tests: the preset leaves LEGACY_PRESETS and joins the agent-session, reasoning-effort and local-Docker parametrisations; the config test asserts the session wiring and holds the agent equal to opencode_search.yaml's apart from tool_servers and system_prompt. No server code changes. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(hle_diamond): describe opencode_hle_tools as an agent-session preset The benchmark README listed opencode_hle_tools among the deprecated relay presets (Scope row, relay paragraphs, effort bullets, Known limitations, Reading sandboxed results, Agent sessions, Reference preset). It now sits with the session presets everywhere, and the Upstream web tools section replaces its Deprecated relay paragraph with the session wiring (episode seed, MCP grant, address exposure, MCP timeout, extra_body effort), a documented run command composed like the other presets (the Docker override composes again), and a note that the 2026-10-26 five-row Docker pilot ran on the relay harness, so no with-tools number is quoted until a pilot is rerun on the session harness. The residual-difference statements (backend, unauthenticated /seed_session under model_and_tools, Gym#5845, oversized pages) are unchanged. The hle_web_tools README's Use in a preset paragraph and the opencode_reference.yaml header say the same. Signed-off-by: Rima Shahbazyan <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Signed-off-by: Rima Shahbazyan <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: yaoyu-33 <[email protected]>
What and why
The HLE-Diamond text presets with tools ran through the
legacy_agent/runrelay on the deprecatedopencode_sandboxed_agentandpi_sandboxed_agent. They now run asopencode_agentandpi_agentagent sessions, driven by the benchmark's own Environment Server,hle_diamond_equivalence_llm_judge_environment_server(single_agent_turn_legacy), the way #5825 and #5826 movebenchmarks/hle. The judge binding, routing name, dataset, prompts and grading are unchanged.opencode.yaml,opencode_search.yaml,opencode_reference.yaml(OpenCode) andpi.yaml,pi_search.yaml(Pi).opencode.yamlandpi.yamlcomposeresponses_api_agents/{opencode,pi}_agent/configs/profiles/offline_science.yaml, asbenchmarks/hle/{opencode,pi}.yamldo, and add only the HLE-Diamond judge and dataset. A test holds the composed agents equal tohle's apart fromresources_serveranddatasets, so the harness settings cannot drift between the two benchmarks. The profiles carry the sandbox image, resources, entrypoint and 16,200 s TTL, the pinned OpenCode binary and Pi runtime,model_onlyegress, the environment note assystem_prompt, OpenCode'spermission.task: deny, and the token limits (OpenCode: 32,768 output tokens per call within 229,376; Pi: 262,144 withremaining_context).opencode_search.yamlandpi_search.yamllist Tavily in the agent'stool_serverswithmodel_and_toolsegress, let the Resources servers leave loopback (absolute_ip_server_types), and give OpenCode's MCP calls 300 s, ashle's search presets do.opencode_reference.yamlinherits the same profile throughopencode_agentand restates only the judge, dataset, tools, egress, note and the reference image.++policy_model.responses_api_models.<model type>.extra_body.reasoning_effort=high. Neither session agent can put an effort on its harness's calls onmain(a session'sopencode_configtakes no model options; Pi's generated provider declares noreasoning_effortsupport, so--thinkingnever leaves the sandbox), and both refuse a requestreasoningfield with 422. The README documents the override and uses it in the Quickstart commands; with the default judge (the policy model) it applies to judge calls too, so the commands composejudge_openai.yaml.sandbox_docker_local.yaml: blocks for the session agents, with the note assystem_prompt. The reference preset's acknowledgement gate is unchanged.*_legacy_agent: as in feat(swe): run the SWE OpenCode configs through single_agent_turn and keep the relay configs as *_legacy_agent #5762, feat(vibench): make the agent-session config the default and keep the relay as vibench_legacy_agent.yaml #5819, feat(hle,apex_shortlist): run the OpenCode presets through opencode_agent sessions #5825 and feat(hle,apex_shortlist): run the Pi presets through pi_agent sessions #5826, the session presets take the plain names, and each relay preset is kept under its name plus_legacy_agent, with a deprecation note that names its replacement. They keep their agent names, sosandbox_docker_local.yamldoes not compose with them (a test holds that).Left alone:
opencode_sandboxed_agentbehind the relay and keep their names,opencode_full.yamlandopencode_search_full.yaml, with the same deprecation note. Their prepare script, which only they use, is renamedprepare_opencode_legacy.py. Agent sessions accept prompt images onmain(feat(opencode): attach prompt images in agent sessions #4922, feat(pi): attach prompt images in agent sessions #4923), but session presets over the full set are a follow-up.benchmarks/hle/is not changed.No issue is linked: the work is tracked internally.
Compatibility
verify_after_agent_error, OpenCodereasoning_effort, OpenCodeoutput_token_policy: remaining_contextwithdeclare_model_limits: false, and Piprovider_compat.supportsReasoningEffort(withthinking: high, which does nothing without it).execution_failure_reward_zero: true, so a harness crash, nonzero exit or deadline became a reward-0 row. On the session presets, as onhle, a run that stops at its output, context or time limit is graded on what it produced, and a harness crash is retried and then reported as a failed rollout, outside the denominator. The crash leaves the agent route as an error (HTTP 502 from OpenCode, an exception from Pi), so the Environment Server handles it as a dependency failure beforeagent_outcome_policyruns, and noby_failure_kindsetting makes it gradable; the README asks to report the failed-rollout count next to every score.hle, instead of the relay preset'sremaining_context; OpenCode asks for its cap on every call, andopencode_agentonmainhas no policy to drop it.offline_scienceprofile leaves the sandboxed profile's 400-step cap andcompaction.auto: falseunset, so compaction, the step limit and session titles follow OpenCode's defaults, and the 14,400 s run budget bounds the episode.opencode_agentaccepts both in a session'sopencode_config; the README gives the per-run overrides. Setting them in the profile would changehleandapex_shortlisttoo, so that is a follow-up.opencode_agent's default rules apply: everything is allowed except listed bash commands (process killing,rm -rfof system paths, raw disk writes, git network commands and others), andwebfetch,websearchandskillare denied. The profile deniestask. The sandboxed presets allowed every command and denied only web fetch, web search and subagents.extra_body(above) instead of each harness's option. Pi requests now carryreasoning_effortwhen the override is set; the deprecated Pi presets never sent it.concurrency: 512limit applies, and the profiles' 16,200 s TTL covers the 14,400 s run budget plus the 1,200 s ready wait. The README asks for--concurrencyat or below 512.slices/partition/*andjudgement_parsing_issue_rate, because the Environment Server forwards aggregation to the judge and the relay did not. Rows carry session fields (response.status,ng_agent_observations,failure_kind) instead ofopencode_*andpi_*.hle_diamond/opencode,opencode_search,opencode_reference,piandpi_searchnow select the session presets; the relay presets arehle_diamond/<name>_legacy_agent.hle_diamond/opencode_fullandhle_diamond/opencode_search_fullkeep their names. Their agent instance is renamed fromhle_diamond_opencode_agenttohle_diamond_opencode_full_agent(sosandbox_docker_local.yamlcan target it apart from the session agent); existing++hle_diamond_opencode_agent...overrides of the full presets must use the new name.prepare_opencode.pyis nowprepare_opencode_legacy.py; dataset names and prepared files are unchanged.hle_diamondrows now name the*_legacy_agentpresets; the agent-name rule is feat(hle,apex_shortlist): run the Pi presets through pi_agent sessions #5826's.benchmarks/hle_diamond/opencode_hle_tools.yaml, which composesopencode.yamland overrideshle_diamond_opencode_agent.responses_api_agents.opencode_sandboxed_agent. After this PR that instance isopencode_agent, so feat(hle_web_tools): add upstream HLE web tools server and Diamond preset #5176 needs rework: composeopencode_legacy_agent.yamlto stay on the relay, or settool_servers,network_accessand the note underopencode_agent. There is no git conflict in that file, so nothing flags it automatically. Draft refactor(hle): migrate web-tool presets to agent sessions #5953 (on top of feat(hle_web_tools): add upstream HLE web tools server and Diamond preset #5176) moves that preset toopencode_agentwithout composingopencode.yaml, so it is unaffected by the rename; both touchbenchmarks/hle_diamond/README.mdandtest_hle_diamond.py, so whichever lands second rebases those.Validation
Unit tests
At
372003e4d, Linux, the repository venv,pytest -q -n 16:resources_servers/equivalence_llm_judge/tests/test_hle_diamond.pybenchmarks/hle/teststests/unit_tests/tooling/test_agent_environment_harness_overlays.pytests/unit_tests/tooling/test_add_legacy_agent_environment_servers.pytests/unit_tests/environmenttests/unit_tests/configresources_servers/equivalence_llm_judge/testsNine tests that restated preset values were removed in review (
cd3a3f096).adb1456ecchanges only the README;372003e4drestores the full presets' names and renames their prepare script.The README's per-run overrides were resolved with
gym env resolve:compaction.auto=falseandagent.build.steps=400land in theopencode_configofhle_diamond/opencodeandopencode_referenceand passopencode_agent's session-config check, and the effort override under each relay preset's named instance reaches that preset's agent (all five OpenCode*_legacy_agentpresets).The session preset tests check invariants rather than restating preset values: the presets route through
single_agent_turn_legacywith no relay and no leftover harness instance; the composed agents validate againstOpenCodeAgentConfigandPiAgentConfig; they equalhle's agents apart from the judge and dataset; they carry no harness effort setting and the README documents the model-server override; the OpenCode denies fortask,webfetchandwebsearchfollow"*": allow(the order OpenCode applies); the preinstalled OpenCode digest, version and path and the Pi version match the images; the sandbox TTL covers the run budget plus the ready wait; and the restated reference and Docker-override blocks do not drift from the presets they copy.Real runs
vllm_modelserver; the judge was the same model server.python:3.11-slim-bookwormwithnetwork_access: inherit, because the science images were not available to that sandbox deployment. Egress was not restricted on these runs.hle_diamond_opencode_agent, orhle_diamond_opencode_reference_agentfor the reference preset):network_access: inherit,sandbox_executable_path: null,sandbox_executable_sha256: null,sandbox_config.image: <public image>. With no executable path, the adapter installs OpenCode 1.17.11 in the sandbox at session start instead of running the image's pinned binary.hle_diamond_pi_agent):network_access: inherit,sandbox_runtime_dir: null,sandbox_config.image: <public image>. With no runtime directory, the adapter installs Node and Pi in the sandbox instead of running the image's/optruntime.vllm_modelagainst the endpoint, with++policy_model.responses_api_models.vllm_model.extra_body.reasoning_effort=highwhere the table says so.1f0589339with the edits of776da65a3(the last README edits came after), and the first two rows again at48b2f8d51after mergingmain.hle_diamond/opencode_searchwith Tavily and the effort override, atcd3a3f096tavily_web_searcheach)hle_diamond/pi_searchwith Tavily and the effort override, atcd3a3f096mcp__tavily__web_searcheach)hle_diamond/opencode_referencewith Tavily and the effort override, atcd3a3f096tavily_web_searcheach)hle_diamond/opencodewith the effort override, at48b2f8d51hle_diamond/piwith the effort override, at48b2f8d51hle_diamond/opencodewith the effort overridehle_diamond/piwith the effort overridehle_diamond/opencode, no overridehle_diamond/pi, no overrideThe search rows asked for a dated fact and told the model to look it up. On all three search presets the model was offered
tavily_web_search,tavily_find_in_pageandtavily_scroll_pagethrough the agent'stool_serversgrant, alongside the harness's own tools, and answered from the search result.Every aggregate carried
slices/partition/{reasoning,knowledge}andjudgement_parsing_issue_rate. Every OpenCode harness call asked formax_tokens: 32768; no Pi call and no judge call carriedmax_tokens.Effort reaches the endpoint. Gym's model-call capture records the harness's request before the model server adds
extra_body, so a logging proxy between the model server and the endpoint recorded the outbound bodies of one more run per preset (OpenCode 3 rows, Pi 2 rows, 0 failures):reasoning_effort: highwas on 3 of 3 OpenCode calls, 7 of 7 Pi calls and all 5 judge calls.Tool probe. Two rows told the model to call
webfetchonhttps://example.comand to run atasksubagent. Every OpenCode request offered onlybash,edit,glob,grep,read,todowriteandwrite; the model's onetaskcall came back as "Model tried to call unavailable tool 'task'". Both rows completed and scored 0 (the model could not do what the row asked). The same probe on the earlier revision, beforemainremovedopencode_agent.yaml'stoolsmap, fetched the page and ran the subagent.Checks
pre-commit runon the changed files atcd3a3f096and372003e4d: passed (ruff, ruff-format, whitespace, end of file; the guardwords hook ran without its private catalog). Atadb1456ec, which changes only the README, no hook other than guardwords applies to it.1f0589339,776da65a3, the two merges,cd3a3f096,adb1456ecand372003e4d).Known limits
reasoning_effort.hle. Follow-up.cais/hle-diamonddataset is gated and was not accessible for the smoke. No benchmark score is claimed.model_onlyormodel_and_toolsrollout completed: the rollouts usednetwork_access: inherit. OpenSandbox does enforcemodel_onlyhere (an earlier probe ofopencodewith the policy on, on the public image, could not resolvedeb.debian.orginside the sandbox). That is also why it cannot run on the public image: without the images' preinstalled OpenCode and Pi, each session installs the harness over the network at start. Running a few rows per harness and a search preset under the presets' own egress needs the science and reference images built from their Dockerfiles and reachable by the sandbox provider.opencode,opencode_searchandopencode_reference. Not reproduced here.opencode_fullandopencode_search_fullstill runopencode_sandboxed_agent.offline_scienceprofile, forhle,hle_diamondandapex_shortlisttogether, whether to restore OpenCode's 400-step cap andcompaction.auto: false.execution_failure_reward_zerodid). A crash reaches the Environment Server as a dependency failure, so this needs a change in the agents or the Environment Server, one that does not also grade infrastructure failures.opencode_agentandpi_agentsessions, so effort does not have to be set on the model server. Draft refactor(hle): migrate web-tool presets to agent sessions #5953 proposes one for OpenCode (sandbox_reasoning_effort).🤖 Generated with Claude Code