Repository navigation
feat(terminal_bench_science): run mini-SWE through Harbor and keep the /run relay preset as miniswe_legacy_agent - #5991
Conversation
A benchmark config may set `harbor_target` (a task folder, a committed entry under environments/harbor/, or a harbor: reference) and define the one agent instance the benchmark runs. `gym eval prepare --benchmark` and `gym eval run --benchmark` then run that target as `gym eval run <target>` does, with the benchmark's harness and its settings. `--agent-type` swaps in another harness's shipped config; the dataset's allowed_agents still decides at prepare. `--agent` is refused rather than ignored. Manifests gain an optional `harbor_target`, mirrored from the config; with it `datasets` is empty and validation checks the target resolves without a fetch. Benchmarks that compose their own servers prepare and run as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…server defaults A benchmark config that names a Harbor target may set the shipped harbor_environment_server instance's settings, such as a longer episode bound. build_run loaded the server's own config (harbor.yaml) after the benchmark config, so the server defaults won: terminal_bench_4/miniswe's 54000 s episode bound resolved to 21600 s. With --agent-type the benchmark config is not loaded at all, so its server settings were dropped too. The settings now travel with the selected agent as server_settings, for the benchmark's own harness and for one --agent-type swaps in. build_run writes them to server_config_<agent>.yaml beside the run config and loads it after harbor.yaml. A test merges the run's config files in Gym's order and checks the benchmark's episode bound wins with both harnesses. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
main split the manifest resolver: `_resolve_config_wiring` now picks a config's agent and resources server for both manifest validation and `gym list environments`. The `harbor_target` handling moves into it, and `_ConfigWiring` carries the target to the manifest composition. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
Main moved the Harbor task-folder guide under data/task-folders/ and the Harbor run docs to agent-interactions/harbor.mdx. The "benchmark config that names a target" section moves there, after Harnesses, and the CLI reference links to its new anchor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
Brings in #5654's mini_swe_agent agent sessions (0dc9f54), which the TB4 preset stacked on this branch runs and the docs example names. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…e_agent sessions benchmarks/terminal_bench_science/miniswe.yaml now runs mini_swe_agent (agent sessions) through single_agent_turn_legacy, as codex.yaml runs codex_agent: the TB4 resources server lends the task sandbox through SandboxAccess and grades in the separate offline verifier. Rows are the Codex profile's prompt-bearing rows (prepare_codex.py). The step limit (none), command timeout (30 s) and the task's 8-hour budget keep the tbsci_* overrides; the episode bound is 46800 s. The relay preset is kept unchanged as miniswe_legacy_agent.yaml with a deprecated manifest. The terminal_bench_science_sandbox provider block moves from codex.yaml to resources.yaml, shared by both session presets. The README documents the two tasks whose working directory is / , which mini_swe_agent refuses at seed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…settings Preparation runs before the run config exists, and it read only the overrides left after the benchmark config was dropped, so a preset's builds:, sandbox, Compose overlay, volume, registry and pairing settings never reached it. Preparation now loads the benchmark config first, below every --config overlay and command-line override; collection keeps the de-duplicated overrides. The benchmark's own top-level keys besides its agent instance now travel as benchmark_settings (not only the Harbor server block), loaded after the server's and the sandbox provider's configs, so a harness --agent-type swaps in keeps them and the keys they interpolate. harbor_benchmark checks the config's include closure for the agent count and for extra resources or environment servers, and refuses an agent instance that sets _inherit_from. A malformed benchmark YAML is a usage error rather than a traceback. Test fixtures use mini_swe_agent. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…its agent Static resolution applies the same agent overrides build_run applies to the generated agent, so a harness whose shipped template leaves resources_server.name for benchmark composition (Terminus) validates. The catalog lookup reports no resources server for a Harbor-backed config. A harbor: target must parse as a hub reference, and a local target must be a directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…nifest The Harbor section lists the settings a benchmark config carries and when they apply, the CLI reference no longer promises --config and --agent-type are equivalent for a Harbor-backed benchmark, and the manifest paragraph matches the field reference's Harbor cases. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test 206f282 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — one BLOCKER and two RISK findings in the mini-SWE migration.
The provider relocation, dataset routing, manifests and preserved relay configuration look consistent. The replacement changes killed-agent scoring, loses the official budget ceiling for larger overrides, and excludes two tasks from the standard benchmark run.
I completed the changed-file review and traced the affected preparation, session, verification and cleanup paths. This was a static review; I didn't execute tests or rollouts. The official task packages aren't mounted, so the task-specific working-directory evidence comes from the committed documentation and the supplied smoke report.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Inline comments (escaped v1):
-
resources_servers/terminal_bench_4/app.pyline 933: BLOCKER — Preserve the killed-agent zero when decoding mini-SWE responsesThe migration makes this unchanged conversion wrong for mini-SWE. A runner killed mid-step returns
status="incomplete"withmini_swe_termination="killed"(adapter). This branch converts that totimeout, so TB4 runs the verifier and can award credit. Previously, the relay passedreason="killed", which the finalizer explicitly scores as zero without verification. A run that writes passing artifacts and then kills its runner can therefore receive reward 1 instead of 0. This changes benchmark scores, not just diagnostics.Replace this line in
_termination_from_responsewith the following narrow branch:if response.status == "incomplete": if (response.metadata or {}).get("mini_swe_termination") == "killed": return AgentTermination(reason="killed")The invariant is that mini-SWE's killed outcome reaches TB4's existing killed-agent policy. Ordinary wall-time, step-limit and context-limit stops must remain verifiable; Codex's completed, incomplete and failed-response handling must remain unchanged. This source-based suggestion hasn't been executed; verify it before adopting it.
Proposed acceptance: feed the response from the killed-mid-step case through this converter and the real finalizer. Assert
termination.reason == "killed", reward 0,source == "agent_killed", an interrupted marker and no verifier call, retaining the existing zero-scoring assertions. A deadline with partial work must still verify astimeout; retain all existing response-status conversion cases. -
benchmarks/terminal_bench_science/miniswe.yamlline 43: RISK — Retain the official eight-hour ceiling above configurable smoke capsWith
++tbsci_agent_max_timeout_sec=30000, mini-SWE can now run for 30000 seconds rather than the task's official 28800 seconds. The adapter caps its configured timeout by the seed budget or request metadata, but this environment's agent seed supplies no budget, and the prepared rows supply only the prompt. The previous relay took the minimum with the resources seed's task budget. Larger overrides can change benchmark results; sufficiently large ones also outlast the resources session and lose grading.Could you carry the official budget into the actual mini-SWE seed or activation request, or cap this pairing's resolved runner timeout? Restore
effective_run_budget = min(28800, configured_cap)for this pinned benchmark. Preserve the default eight-hour run, smaller caps such as 900 seconds, and separate installation/verifier allowances. Don't hard-code this benchmark's ceiling into the generic adapter, where other pairings may legitimately have different budgets. The exact transport patch needs a design choice because the current resources seed response has no budget field; increasing the episode timeout alone won't fix this.Proposed acceptance: compose this preset with overrides 900, 28800 and 30000, construct the actual environment-to-agent requests, and assert effective run budgets of 900, 28800 and 28800. Retain the step-limit and command-timeout override assertions, and check that the resources lifetime exceeds installation plus the capped run and close allowance.
-
benchmarks/terminal_bench_science/miniswe.yamlline 32: RISK — Keep the full-task preset working until root-workdir tasks can migrateThe replacement selects an adapter whose seed guard rejects workdir
/, while TB4 passes the task image's actual working directory through. As the new README records,ode-law-discoveryandgeometric-pharmacophore-alignmentconsequently never execute and produce no reward. The supplied smoke confirms the first refusal. An otherwise successful all-task run therefore measures only 68 of the 70 tasks; documenting a manual denominator correction doesn't make the standard output a full-benchmark score.Could you keep the existing
terminal_bench_science/miniswepreset on the full-task relay until these tasks have a supported session path, making the limited session pairing opt-in meanwhile? Alternatively, complete and verify task-specific working-directory handling before replacing the preset. Don't globally override task working directories or simply remove the disjoint-directory guard: ordinary tasks must retain their image workdirs, and cleanup must not remove task state. The official packages aren't mounted here, so I can't safely suggest the exact per-task patch.Proposed acceptance for the replacement: unfiltered preparation retains all 70 identities, and both named tasks reach agent execution, official verification and cleanup with reward-bearing results rather than seed refusals. Retain an ordinary
/apptask, a Compose task borrowing only its main sandbox, smaller timeout overrides, and the legacy preset's behavior. If support remains intentionally limited, verify that the existing default still runs all 70 and the limited pairing requires explicit selection.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…nd state the run budget A mini-SWE runner killed mid-step returns an incomplete response with mini_swe_termination "killed". TB4 mapped every incomplete response other than max_output_tokens to a timeout and verified it, so such a run could earn credit, where the /run path scores a killed agent as 0 without its verifier. Map that response to the killed termination. Wall-time, step-limit and context-limit stops are still verified, and other harnesses' responses map as before. The session seed carries no task budget, so tbsci_agent_max_timeout_sec is the run's wall-clock limit itself, as tbsci_agent_timeout_sec is for Codex. Correct the miniswe.yaml comment and the READMEs, which said the task's budget bounds it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test cb0a46f |
yaoyu-33
left a comment
There was a problem hiding this comment.
Team review of the mini-SWE session preset, including what the typed session contract asks of it. Thanks for cb0a46f: mapping mini_swe_termination: killed to TB4's killed termination restores #5194's rule (0, agent_killed, no verifier) on this path, and the budget wording now matches what the seed carries. That settles the CI bot's killed-scoring and budget points.
Typed session contract. No change is needed in this preset. TB4 serves its typed seed itself (_seed_resources_session), not through the base's seed_request_model. With #5987's responses_create_params on ResourcesSeedSessionRequest, the body still validates, identity still comes from task_data only, and a retried seed from single_agent_turn dumps the same params, so the session.resources_request != body check still replays an identical retry and refuses a changed one (app.py#L505). A TB4 test of a typed seed that carries the params (identical retry replays, changed one 409s) would be worth adding once #5987 lands. The budget gap you documented is the other typed-contract item: AgentSeedSessionRequest.agent_timeout_sec exists, but single_agent_turn never fills it (single_agent_turn/app.py#L545-L553). Filling it from the task would restore the relay's min(task budget, override) for every harness. That is a core follow-up, not this PR.
Docs outside the diff. integrate-existing-agents.mdx#L42 still says Terminal-Bench-Science must keep its /run adapter. That page has no overlap with #5697 and could be updated here. miniswe_sandboxed_agent/README.md#L12 says the same, and you have deferred it on purpose.
PR body. The Compatibility list could also say that the default preset no longer captures token IDs or logprobs. The README says so (README.md#L296), but the body does not.
Validation on our side: the PR's test_terminal_bench_science.py (52) and test_environment_validation.py (78) pass at 206f282, and test_environment_validation.py + test_session_contract_repo.py (80) pass with main merged. We did not run a real sandbox or model.
Verdict: SHIP WITH CARE. The one item to decide explicitly is the 68-task default mean (inline). The rest are notes.
| domain: coding | ||
| description: The pinned 70-task Terminal-Bench-Science v0.1 dataset with the mini-SWE 2.4.6 native loop owned by the | ||
| agent server and separate offline official verification. | ||
| description: The pinned 70-task Terminal-Bench-Science v0.1 dataset with mini-SWE 2.4.6 running in each task sandbox |
There was a problem hiding this comment.
RISK: the canonical terminal_bench_science/miniswe now reports mean/reward over at most 68 tasks. ode-law-discovery and geometric-pharmacophore-alignment are refused at seed (mini_swe_agent/app.py#L308-L315), which is right as a harness failure, but this description still says "70-task" and the leaderboard counts those two as 0. Could you state the 68-task coverage here and in the Measurement contract, or keep the canonical name on the full-coverage relay until mini-SWE accepts a / workdir? Separately, this preset changes the default adapter and its scores are not comparable with the relay, so a version: 0.2.0 bump, as #5961 and DeepSWE (#4560) did, would mark that.
There was a problem hiding this comment.
Resolved, thanks. 0.2.0 marks the new measurement, and the manifest and the Measurement contract now state the coverage limit (at most 65 tasks: the three Compose skips plus the two workdir-/ refusals). They also point to miniswe_legacy_agent for all 70 (README.md#L25-L36). Keeping the canonical name on the Harbor route is a clear, documented choice.
| # As in codex.yaml, the TB4 resources server owns the task and verifier sandboxes and lends the task sandbox | ||
| # through SandboxAccess. mini_swe_agent installs its runtime there and runs mini-SWE, and single_agent_turn_legacy | ||
| # seeds both, closes mini-SWE before grading, then closes Resources. Grading, partial credit, artifacts, and EFS | ||
| # logs are unchanged from the relay profile (miniswe_legacy_agent.yaml). Rows carry the official instruction as |
There was a problem hiding this comment.
NOTE: "artifacts ... are unchanged from the relay profile" no longer holds: this path writes no <tbsci_jobs_dir>/agent artifacts, and the trajectory comes back in the agent session's close bundle (as your Compatibility section says). Likewise README.md#L52 ("Preparation writes identity rows only") is now true only for the /run profile; this default writes the prompt-bearing benchmark_codex.jsonl rows.
There was a problem hiding this comment.
Resolved by the rewrite. The header no longer claims the relay's artifacts, and the README now limits "identity rows only" to the /run profile's prepare.py. It also says the Harbor preset reads instructions from the pulled folders (README.md#L72-L76).
| # wall-clock limit; its default is every v0.1 task's 8-hour budget (as Codex's timeout in codex.yaml). | ||
| step_limit: ${oc.select:tbsci_max_steps,0} | ||
| step_timeout: ${oc.select:tbsci_step_timeout_sec,30} | ||
| sandbox_runner_timeout_seconds: ${oc.select:tbsci_agent_max_timeout_sec,28800} |
There was a problem hiding this comment.
NOTE, two inherited agent settings that matter for 8-hour runs:
concurrency: 32(mini_swe_agent_sandboxed.yaml#L18) wraps the whole run. With++tbsci_concurrencyabove 32, the extra episodes hold ready task sandboxes while they wait, and TB4's 36000 s seeded deadline can expire mid-run.concurrency: ${oc.select:tbsci_concurrency,8}would keep them in step. The default of 8 is safe, and codex.yaml has the same shape.session_close_timeout_seconds: 60bounds trajectory collection at close; codex.yaml raised its own to 300 for 8-hour sessions (codex.yaml#L55). A long mini-SWE trajectory may want the same.
There was a problem hiding this comment.
Both points still hold on the Harbor route, since the preset inherits them from mini_swe_agent_sandboxed.yaml#L18-L24.
- Concurrency. The 32-slot semaphore wraps the activation (app.py#L638), but Harbor's task deadline starts once the sandbox is ready (harbor/app.py#L907-L911). With
--concurrencyabove 32, queued episodes spend their budget waiting, and a later full 8-hour run can end inharbor:task_deadlineand be retried.tbsci_concurrencydoesn't reach this route, so the knob is now--concurrency. - Close timeout. The 60 s close timeout bounds
collect()inside the activation. With no step limit, an 8-hour trajectory can be large, and a timed-out collect fails the activation as a retryabledependency_failure.codex.yamluses 300 s.
TB4's preset on main has the same shape, so this could be a follow-up for both. It could also be two lines here: session_close_timeout_seconds: 300 and a concurrency at or above the run concurrency (or a README note to keep --concurrency at 32 or below).
| name: terminal_bench_science_miniswe_agent | ||
| # Provisioning, the mini-SWE runtime installation, the 8-hour agent budget, and verification (up to | ||
| # 12000 seconds for the slowest verifier, plus its startup). | ||
| default_episode_timeout_seconds: ${oc.select:tbsci_episode_timeout_sec,46800} |
There was a problem hiding this comment.
NOTE: 46800 s covers install + 28800 + the slowest verifier, but not every task's worst case. qsm-reconstruction's v0.1 task.toml allows build 6000 + agent 28800 + verifier 6000 + verifier build 6000 = 46800 before the mini-SWE install and close. Real pulls rarely hit those bounds, and Codex shares the number, so documenting the assumption in this comment is probably enough.
There was a problem hiding this comment.
This one no longer applies. On the Harbor route the images are built at prepare, and the server charges build_timeout_sec only for a Dockerfile overlay, so qsm-reconstruction needs about 38k s. The slowest task (linked-cell-suppression, 12000 s verifier) needs 44130 s with one sandbox start and 46755 s with every pull retry, both inside 46800. Optional: the comment at miniswe.yaml#L24-L26 could also name the seed's 1200 s sandbox-ready wait, which the cap has to cover.
|
|
||
| - Terminal Bench 4 Harbor task folders (after `gym dataset pull terminal_bench_4`), in the sandbox the Harbor | ||
| environment server lends. | ||
| - Terminal-Bench-Science v0.1 ([`benchmarks/terminal_bench_science/miniswe.yaml`](../../benchmarks/terminal_bench_science/miniswe.yaml)) |
There was a problem hiding this comment.
NOTE: with this pairing in place, integrate-existing-agents.mdx#L42 ("Legacy /run benchmark presets, including Terminal-Bench-Science, must keep their current adapter") is out of date. That page does not overlap #5697, so could it be updated in this PR?
There was a problem hiding this comment.
Resolved, thanks. The guide now says the TB-Science miniswe preset has migrated and that the /run preset remains as miniswe_legacy_agent (integrate-existing-agents.mdx#L55). The older adapter's README says the same.
…w a gym eval run example for it A variant that repeats harbor_target and includes a Harbor-backed preset lost the preset's benchmark settings: the preset also defines the agent instance, so it was read as the harness's shipped config and its server settings (the episode bound) fell back to the server's default. A config that sets harbor_target is now a benchmark source; only configs that define the agent without a target are harness configs. The environment catalog carries the manifest's harbor_target, so inspecting a Harbor-backed entry shows a `gym eval run` example instead of `gym env start`, which does not compose its Harbor environment server. The Harbor page now says `gym list benchmarks` lists such a benchmark through its manifest. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…hanges Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…into the TB-Science preset Signed-off-by: weijia chen <[email protected]>
Signed-off-by: weijia chen <[email protected]>
…nvironment server terminal_bench_science/miniswe now names the Harbor target terminal_bench_science, as terminal_bench_4/miniswe does, instead of composing mini_swe_agent sessions with the TB4 resources server. The new committed entry environments/harbor/terminal_bench_science pins the package-store dataset by the digest manifest.json already records, and carries only verifier overrides: the resources server's three verifier timeouts, the agent's CPUs and memory for the 58 verifiers that declare none, and each package's no-network verifier restriction on [verifier], where the loader applies it as the separate verifier's egress policy. The preset keeps the tbsci_* harness overrides and the 46800 s episode bound, allows mini-SWE's 900 s install, waits 1200 s for lazily pulled images, and sets the resources server's three sandbox labels. Reverted what only the session route needed: the TB4 resources server's mapping of a killed mini-SWE response and its tests, the provider block's move from codex.yaml to resources.yaml, and the session docs. The relay preset stays as miniswe_legacy_agent; Codex stays on the resources server. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…rbor preset Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test c00c56d |
Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test bec8aee |
Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test b32b03e |
yaoyu-33
left a comment
There was a problem hiding this comment.
Re-review at b32b03e. The PR now takes a different route than the session preset I reviewed at cb0a46f: terminal_bench_science/miniswe runs mini_swe_agent through the generic harbor environment server on a committed entry, matching TB4 in #5697, and the /run relay stays available as miniswe_legacy_agent. This route closes several earlier points: each row now carries the task's 8-hour budget, so ++tbsci_agent_max_timeout_sec can only shorten it (mini-SWE takes the min with the seed's agent_timeout_sec). The coverage limit and the 0.2.0 version bump are documented, and the Fern guide and both mini-SWE READMEs are updated. I've replied on each earlier thread.
What holds. We parsed dataset.toml and compared it against all 70 upstream v0.1 task.toml files at f81afac4.
- The 70 task keys match
manifest.json, and the source digest matches its pin. - The three verifier timeouts match
tbsci_verifier_timeout_overrides. - The 58 sized verifiers each equal that task's agent
cpus/memory_mb, and the 12 that declare their own are left untouched. - Moving
no-networkfrom[verifier.environment]to[verifier]is the shape the loader accepts, and it reaches the separate verifier as a deny policy. harness_setup_allowance_s,sandbox_ready_timeout_sandsandbox_metadataare real server fields and reach every sandbox role, the verifier included.- 46800 s covers the slowest task (12000 s verifier) even with every image-pull retry, which needs 46755 s.
What's left is inline:
- The documented Harbor command stops at preparation unless the three Compose tasks are excluded.
- The entry README's direct command runs without the preset's episode cap.
- Two deployment settings from
resources.yamldon't carry over. - Oracle validation covers only 6 of the 65 runnable tasks.
- A few smaller notes. The
concurrency/session_close_timeout_secondspoint from last round still applies on this route (replied in that thread).
CI is green at this head. We read the code and re-checked the task packages; we did not run a sandbox or a model.
Verdict: SHIP WITH CARE. Once the run command and entry README are fixed and a wider oracle validation is in, this is ready from my side.
| gym dataset pull terminal_bench_science | ||
| gym eval run --benchmark terminal_bench_science/miniswe --sandbox opensandbox \ |
There was a problem hiding this comment.
RISK: this command stops before any server starts. The three unsupported Compose tasks end up in PreparedTaskset.skipped, and gym eval run refuses a non-empty skip list without --skip-unloadable (eval.py#L1613-L1617). The same goes for gym dataset validate terminal_bench_science with no selection at L521. The 6-task smoke didn't hit this because a selection moves those tasks out of the skip list. Could you add the exclusion to both commands here and in the entry README, and say that the run refuses without it? The manifest description and mini_swe_agent/README.md say the tasks "are skipped", which reads as automatic.
| gym dataset pull terminal_bench_science | |
| gym eval run --benchmark terminal_bench_science/miniswe --sandbox opensandbox \ | |
| gym eval run --benchmark terminal_bench_science/miniswe --sandbox opensandbox \ | |
| --exclude-tasks inverse-lithography,noisy-blackbox-optimization,protein-active-learning \ |
| gym dataset validate terminal_bench_science --sandbox opensandbox | ||
| gym eval run terminal_bench_science --agent mini_swe_agent/mini_swe_agent_sandboxed --sandbox opensandbox \ |
There was a problem hiding this comment.
RISK: the direct gym eval run terminal_bench_science --agent mini_swe_agent/mini_swe_agent_sandboxed doesn't load the preset's server settings. For a single-step task the episode gets min(default_episode_timeout_seconds=21600, task budget) (harbor/app.py#L814-L819), so every 8-hour run is cut at 6 h and retried instead of scored. It also runs with the 300 s setup allowance, without the OOM and s3-hostpath labels, and with mini-SWE's 500-step limit. Could the example use gym eval run --benchmark terminal_bench_science/miniswe ... instead (with the --exclude-tasks list), or be marked as a short smoke that needs those overrides?
| sandbox_metadata: | ||
| nemo.nvidia.com/resources: custom | ||
| nemo.nvidia.com/oom-kill: process | ||
| nemo.nvidia.com/s3-hostpath: 'false' |
There was a problem hiding this comment.
NOTE: two deployment settings in resources.yaml don't carry over to this preset.
- Disk. The resources server raises disk to 100 GiB. Here each sandbox keeps its package's
storage_mb(2-10 GiB for most tasks). An OpenSandbox disk eviction maps toPROVIDER_UNAVAILABLE(provider.py#L2526-L2537), so the episode is retried and then left out ofmean/reward. The resources server scores the same death as 0, so this pushes the Harbor mean up.sandbox_resources_overridereplaces only the keys it names and applies to the verifier too (app.py#L351-L353). - Resource requests.
sandbox_provider_options.resource_requests: limits(resources.yaml#L45-L46) is missing, so OpenSandbox falls back to the server's default requests. That matters for CPU-bound verifiers:certified-sparse-regressionalready needed 4002 s on 4 CPUs.
Same gap in TB4's preset on main.
| sandbox_metadata: | |
| nemo.nvidia.com/resources: custom | |
| nemo.nvidia.com/oom-kill: process | |
| nemo.nvidia.com/s3-hostpath: 'false' | |
| sandbox_metadata: | |
| nemo.nvidia.com/resources: custom | |
| nemo.nvidia.com/oom-kill: process | |
| nemo.nvidia.com/s3-hostpath: 'false' | |
| # The resources server's 100 GiB minimum disk and request-equals-limit scheduling. | |
| sandbox_resources_override: | |
| disk_gib: ${oc.select:tbsci_min_disk_gib,100} | |
| sandbox_provider_options: | |
| resource_requests: limits |
| # records for the resources server's preset, so both paths run the same packages. | ||
| source = "harbor:terminal-bench-science/terminal-bench-science@sha256:91531bf50016a7c64f6cc60794a17c64c6b2c14858a8ae0de39ca16f2abd611a" | ||
|
|
||
| # The overrides below are the ones the resources server's preset applies (benchmarks/terminal_bench_science/README.md, |
There was a problem hiding this comment.
RISK (evidence): these overrides are new on this route for every task: verifier network on [verifier] for all 70, verifier CPUs/memory for 58, and three timeouts. So far gym dataset validate has run on 6 tasks, and the benchmark checklist asks for oracle validation of the supported set. Could you run gym dataset validate terminal_bench_science --exclude-tasks <the three Compose tasks> over the remaining 67, or at least these: the three timeout overrides, linked-cell-suppression (12000 s verifier), the two untested Compose tasks (longitudinal-clinical-agent, tamp-skill-planning) and a sample of the resized verifiers? Please share the report's pass/unvalidated counts.
| # `gym dataset pull terminal_bench_science` fetches the source below into this folder (the task folders and | ||
| # manifest.toml it writes are gitignored); `gym dataset validate terminal_bench_science` and | ||
| # `gym eval run terminal_bench_science ...` then resolve the entry name to this folder. | ||
| [gym] |
There was a problem hiding this comment.
NOTE: the Harbor checklist asks [gym] for a license and allowed_agents. A license alone switches the effective split to validation (dataset_config.py#L149-L153), so it needs type = "benchmark" beside it. With no allowed_agents, --agent-type admits any harness, but only mini_swe_agent has a pairing run here. Could you either list the harnesses with a pairing run, or keep it open and say in the README's --agent-type sentence that other harnesses are unproven? TB4's entry on main has the same gap, so this is not a blocker.
| [gym] | |
| [gym] | |
| type = "benchmark" | |
| license = "Apache 2.0" |
| memory_mb = 4096 | ||
| network_mode = "public" | ||
|
|
||
| [gym.tasks."ode-law-discovery".verifier] |
There was a problem hiding this comment.
NOTE, optional: the two workdir-/ tasks could run on this route with one entry override each. workdir is a HarborEnvironment field the loader reads (task.py#L502), and the seed creates and chowns it (session.py#L204-L211). The data is at absolute paths: /data, /results for ode-law-discovery, and /root/data, /root/results for geometric-pharmacophore-alignment. So workdir = "/root" (or /data) would avoid the mini-SWE refusal. It is a deviation from upstream, which starts in /. It would need a Deviations row, a check that both instruction.md files use absolute paths, and a smoke. Keeping the documented limit is also fine.
| settings = OmegaConf.create(benchmark.agent.benchmark_settings) | ||
| harbor = settings.harbor_environment_server.environment_servers.harbor | ||
| # Harness setup, the 8-hour agent budget, the separate verifier's start and the 12000-second verifier. | ||
| assert harbor.default_episode_timeout_seconds > harbor.harness_setup_allowance_s + 28800 + 1200 + 12000 |
There was a problem hiding this comment.
test_terminal_bench_science.py:919
NOTE: this bound doesn't test the claim. The real budget is 1200 ready + 900 setup + 28800 + 12000 + 30 grace + 1200 verifier start = 44130 s, and 46755 s with pull retries. The assertion only requires more than 42900, so a cap of 43000 passes and still cuts linked-cell-suppression. Our benchmark guide skips YAML-binding unit tests for presets in favour of gym env validate plus a real run. I'd drop this test's binding assertions, or at least use harbor.sandbox_ready_timeout_s twice and add the verifier grace. The entry test's digest and override checks are worth keeping.
| description: The pinned 70-task Terminal-Bench-Science v0.1 dataset with the mini-SWE 2.4.6 native loop over the | ||
| legacy /run relay and separate offline official verification. Superseded by terminal_bench_science/miniswe. |
There was a problem hiding this comment.
NOTE, naming (AGENTS.md: "Name things by what they are"): miniswe_legacy_agent is the right file name, since it names the legacy_agent environment server, as in #5697. In this new description, though, "native loop" and "legacy" are vague qualifiers. The same goes for the PR title's "retain the legacy preset", which could read feat(terminal_bench_science): run mini-SWE through Harbor and keep the /run relay preset as miniswe_legacy_agent. Smaller instances: "native bash profile" in miniswe_legacy_agent.yaml:11 and "The older adapter" in mini_swe_agent/README.md:66, which could name miniswe_sandboxed_agent.
| description: The pinned 70-task Terminal-Bench-Science v0.1 dataset with the mini-SWE 2.4.6 native loop over the | |
| legacy /run relay and separate offline official verification. Superseded by terminal_bench_science/miniswe. | |
| description: The pinned 70-task Terminal-Bench-Science v0.1 dataset with mini-SWE 2.4.6's own agent loop, run by | |
| miniswe_sandboxed_agent over the legacy_agent /run relay, and separate offline official verification. Superseded by terminal_bench_science/miniswe. |
- Run and validate commands exclude the three Compose tasks the route cannot load, and say why the run refuses without it; the entry README points at the benchmark instead of a direct run without its settings. - The preset carries the resources server's 100 GiB disk and resource_requests: limits, and gives mini-SWE 300 s to return its trajectory at close; the episode-cap comment names the sandbox-ready waits. - The entry declares type = "benchmark" and its license; the READMEs say other harnesses are unproven here and to keep --concurrency within mini-SWE's 32 sessions. - The relay preset's descriptions name its adapter and relay; the preset test keeps only the composition check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test 72c9e5c |
yaoyu-33
left a comment
There was a problem hiding this comment.
Re-reviewed 72c9e5c, including the author's follow-up to the earlier full Harbor review. No blocking finding remains. The run examples now select the supported subset, the preset carries the disk and scheduling settings without losing task CPU/memory, close has 300 seconds, and the licensed entry retains its benchmark split.
Validation: seven focused tests and a probe through the actual preset, generated configuration, and real task/verifier sandbox-spec consumers passed on the workstation at this exact tree. Required source CI passed, including all core/server shards, sandbox tests, coverage and Nemo_CICD_Test: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43805106145. The workflow's remaining failure is the optional environment-compliance report.
The author-reported model smoke and broader oracle results remain the runtime evidence; I did not rerun a model. Three persistent verifier-fork failures, two untested Compose tasks, root-workdir refusals and the partial benchmark denominator are disclosed; no full-dataset or score-parity claim is made. The focused workstation environment lacked Ray, so its probe checked the inherited agent configuration rather than importing the complete mini-SWE runtime; the relevant CI suites passed.
Two nonblocking documentation details remain: dataset validation processes loadable tasks before reporting skips, while eval run refuses beforehand; the 100-GiB override applies to the task/main and separate verifier, not Compose sidecars.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43806841213 |
…route terminal_bench_science/pi, /opencode and /claude_code now name the Harbor entry with harbor_target, as terminal_bench_science/miniswe does (NVIDIA-NeMo#5991), instead of composing the TB4 resources server and single_agent_turn_legacy. Each carries the miniswe preset's server settings with 1200 s of harness setup, and its CLI's Harbor-style client settings. Model calls go through the Gym model server: Pi and OpenCode no longer have a direct endpoint (NVIDIA-NeMo#5458), and the README says to run them with openai_model, which passes chat requests through and keeps reasoning separate; vllm_model's chat route returns it inside the message text. Claude Code calls the model server's /v1/messages route; the preset sets model_server because the shipped config sets no route and the CLI would otherwise call Anthropic's API. OpenCode moves to 1.17.11, the adapter's tested version. Signed-off-by: gwarmstrong <[email protected]>
What and why
terminal_bench_science/miniswewas still on thelegacy_agent/runrelay with the deprecatedminiswe_sandboxed_agent. #5654 left it there "until it has a supported migration path". This PR moves it to the same route asterminal_bench_4/miniswein #5697: a committed Harbor entry,environments/harbor/terminal_bench_science, run bymini_swe_agentthrough the genericharborenvironment server. The preset names the entry withharbor_target(#5794).instruction.md, read from the task folder, and the task's own 8-hour agent budget.tbsci_max_steps,tbsci_step_timeout_secandtbsci_agent_max_timeout_secoverrides.--agent-typeruns another harness on the same entry, so TB-Science needs no second task path per harness.terminal_bench_science/codexstays on the TB4 resources server and is unchanged. This PR changes no server code.No issue is linked: the work is tracked internally.
What changes:
environments/harbor/terminal_bench_science/(new):dataset.tomland a README, liketerminal_bench_4.[gym]declarestype = "benchmark"andlicense = "Apache 2.0"(a license alone would make the splitvalidation).allowed_agentsstays open; both READMEs say onlymini_swe_agenthas been run on this entry.benchmarks/terminal_bench_science/manifest.jsonalready records for the resources server (sha256:91531bf5…), so both paths run the same 70 packages.gym dataset pull terminal_bench_sciencefetches the task folders (gitignored).finite-free-stamandgen-turan-paths1800 s,certified-sparse-regression7200 s.[verifier.environment]declares neither get the task's agent allocation. A sandbox provider otherwise applies its own default (1 CPU, 2 GiB on OpenSandbox), with whichhighdim-mediation-debiasing's reference solution loses its verifier.[verifier.environment].network_mode = "no-network". Gym's Harbor loader applies a verifier restriction from[verifier].network_mode, as an egress policy on the separate verifier's sandbox, and refuses one on[verifier.environment]("verifier.environment network restrictions are not supported yet"), which would refuse every task. So each task's restriction is set on[verifier]and its verifier environment is public; the verifier sandbox still has no egress (OpenSandbox only).benchmarks/terminal_bench_science/miniswe.yamlsetsharbor_target: terminal_bench_scienceand loadsmini_swe_agent_sandboxed.yaml.step_limitis${tbsci_max_steps,0},step_timeoutis${tbsci_step_timeout_sec,30}, andsandbox_runner_timeout_secondsis${tbsci_agent_max_timeout_sec,28800}. Each task's own budget can only shorten the cap.++tbsci_episode_timeout_sec), as for Codex. The worst case is 1200 s sandbox ready + 900 s harness setup + the 28800 s agent budget + the 12000 s slowest verifier with 30 s grace + 1200 s verifier ready = 44130 s, or 46755 s with every image-pull retry. The server's default of 21600 s would cut a long run short.harness_setup_allowance_s: 900, mini-SWE's install timeout. The default 300 s would end a slow install plus a full run and a long verifier as a task deadline.sandbox_ready_timeout_s: 1200for lazily pulled images (some carry a 6 GB Mathlib).sandbox_metadata: the three labels the resources server's preset sets (custom resources, a single-process OOM kill, no shared S3 mount).sandbox_resources_override.disk_gib: 100(++tbsci_min_disk_gib; every package'sstorage_mbis at most 20 GiB, and OpenSandbox evicts a sandbox that writes past its limit) andsandbox_provider_options.resource_requests: limits.session_close_timeout_seconds: 300, as for Codex: returning an 8-hour trajectory at close can take longer than the default 60 s.harbor_target,resources_server: null,agent_server: mini_swe_agent,datasets: []andprompt_source: agent. Its version is0.2.0: the adapter and the route changed, its scores are a separate measurement from the relay's, and at most 65 of the 70 tasks can return a reward before other setup/runtime failures (see Known limits). Its description says the three unsupported Compose tasks must be excluded. This is an upper bound, not validated coverage.benchmarks/terminal_bench_science/miniswe_legacy_agent.yamlkeeps the previous/runpreset unchanged asterminal_bench_science/miniswe_legacy_agent, with a deprecation note and lifecycledeprecated. This follows the*_legacy_agentnaming of feat(hle,apex_shortlist): run the OpenCode presets through opencode_agent sessions #5825 and feat(terminal_bench_4): run the mini-SWE preset on the Harbor environment server and keep the relay preset as miniswe_legacy_agent #5697.--exclude-tasks inverse-lithography,noisy-blackbox-optimization,protein-active-learning, sincegym eval runandgym dataset validaterefuse a non-empty skip list (or take--skip-unloadable), and the README says to keep--concurrencywithin mini-SWE's 32 sessions. The "Measurement contract" names the three excluded Compose tasks and two root-workdir seed refusals. Gym's defaultmean/rewardcounts only scored trials. The scoring section distinguishes measured verifier failures from excluded infrastructure failures, Harbor's killed-run verification, and resources-server-only CTRF partial credit.gym eval run terminal_bench_science --agent ...as a short smoke only, since it lacks the preset's episode cap, setup allowance, labels, disk and step settings.mini_swe_agentREADME lists the TB-Science Harbor folders under "Pairings and limits", says the three Compose tasks must be excluded, and its note onminiswe_sandboxed_agentnow names only the/runpreset.miniswe_sandboxed_agentover thelegacy_agent/runrelay./runpreset remains asminiswe_legacy_agent.test_miniswe_profile_runs_the_harbor_entry_with_mini_swechecks thatharbor_benchmark()resolves the Harbor target and the mini-SWE agent. Preset values are checked by the real runs below rather than by YAML-binding assertions.test_the_terminal_bench_science_entry_pins_its_digest_and_overrides_only_verifierschecks that the entry's source matchesmanifest.json, that it declarestype = "benchmark"and its license, that it has no environment or artifacts overrides, the three timeouts, the 70 network moves and the 58 sized verifiers.miniswe_legacy_agent.yaml.test_current_benchmark_manifests_match_runtime_compositionalso coversterminal_bench_science/miniswe_legacy_agent.Pre-flight checks against the 70 pinned v0.1 packages (
task.tomlandenvironment/Dockerfileat tagv0.1.0):[agent].user, whichmini_swe_agentrefuses. No agent Dockerfile setsUSER.builds.repository).ode-law-discoveryandgeometric-pharmacophore-alignment, set noWORKDIR, so their agent starts in/.mini_swe_agentrefuses a working directory that contains its session directory, so both fail at seed (see Known limits).Compatibility
gym eval run --benchmark terminal_bench_science/miniswekeeps its name and thetbsci_*harness overrides, but now:gym dataset pull terminal_bench_scienceinstead ofgym eval prepare, and the task images built and recorded (or prepared with a build tool).tbsci_split_sandbox_endpoints,tbsci_sandbox_model_base_url,tbsci_jobs_dir, the Compose service overrides) no longer apply to it.mini_swe_agentdoes not wire up. The/runprofile captured training tokens.--exclude-tasks) and refuses two root-workdir tasks at agent seed. At most 65 tasks can return rewards, before other setup/runtime failures; this is not measured full-dataset coverage (manifest version0.2.0, see Known limits).mini_swe_terminationinstead ofminiswe_termination.--benchmark terminal_bench_science/miniswe_legacy_agent, with the same rows, settings and outputs as before.terminal_bench_science/codexand the TB4 resources server are unchanged.Additional review and validation
The re-review at
b32b03e1is addressed in72c9e5c403801d3b675006811ecff63a1933580b:resource_requests: limitsand a 300 s close timeout;typeandlicense;On that commit, the unit tests and
pre-commitpass (see "Unit tests"). The 65-task oracle under "Validation" ran with the same preset settings.Main
6096dafbc9721044e7c21edfaa736e9361717d59(#5697) was merged inb32b03e1430bd5908978c3b04ba9405dd6148027to resolve the shared mini-SWE README conflict. Both benchmarks keep their Harbor defaults and deprecated relay presets; the stale TB-Science note in the old adapter README is corrected. The TB-Science runtime/configuration is unchanged frombec8aee3, and main's TB4 migration is preserved.On the resulting tree
3e577668460b6ad2a31393fe82e47997739e1c17, workstation verification passed 159 distinct cases: the Harbor-entry test file, five current TB4/TB-Science manifest cases, and the Harbor benchmark CLI tests. The actual-preset config probe and full pre-commit also passed, without modifications. Thirteen fixture setups initially hit workstation Git 2.25's unsupportedgit init -b; only those cases were rerun with a task-local adapter that initializes the fresh fixture repository and selects its branch. No product code or assertions were changed. No model run was repeated for this documentation conflict resolution.The documentation-only correction in
bec8aee36f0432799cf96938cbf39375a8d8e009changes the benchmark README, Harbor-entry README and manifest description. It does not change runtime code or configuration.c00c56da85ae490031294b3a4584e3752fe11dea, 57 focused tests passed: the new Harbor-entry test, the three current TB-Science manifest cases, andtests/unit_tests/cli/test_eval_harbor_benchmark.py. A separate probe composed the actual shipped preset throughharbor_benchmark,build_runand the config parser, checking defaults, overrides, routing and sandbox labels.pre-commit run --all-filespassed on the final repair treeb7407f679f1736085c45d47d120015afa50d93e0without modifications. All verification ran on the workstation; no dependencies were installed.f81afac4f11048e77a15dfc8fb1dbfb897fea0cewith the current preparation validator. It established the three refusals above; no full 70-package materialization or Compose execution was performed.partial_creditare projected only by the resources-server presets.Validation
Unit tests
At
72c9e5c4:gym env test --resources-server terminal_bench_4: 368 passed, 1 skipped.pytest tests/unit_tests/data/tasks/harbor/test_harbor_entries.py: 101 passed.pytest tests/unit_tests/cli/test_eval_harbor_benchmark.py tests/unit_tests/environment/test_environment_manifest.py tests/unit_tests/environment/test_environment_validation.py: 321 passed. This includes the manifest-vs-runtime composition check forterminal_bench_science/miniswe_legacy_agentandterminal_bench_science/codex.Real runs
On an OpenSandbox CPU deployment, with agent and verifier images built from the pinned packages and recorded in an uncommitted build record (
++builds.enabled=false). The agent images carry one extra layer with an unrelated harness binary; WORKDIR, USER and the task's files are unchanged. Six tasks, including both workdir-/tasks.gym dataset validate terminal_bench_scienceon the six tasks: every reference solution scored 1.0, each graded in its own verifier sandbox with the no-network policy.gym eval run --benchmark terminal_bench_science/miniswe ++tbsci_agent_max_timeout_sec=1800with concurrency 6. The model was a Nemotron checkpoint served by vLLM. The agent was capped at 30 minutes, with no step cap.variable-star-vettingneo-orbit-determinationmendota-ice-phenologyhighdim-mediation-debiasingode-law-discovery/)geometric-pharmacophore-alignment/)mini_swe_termination: timeout.highdim-mediation-debiasing's verifier ran at the agent's 4 CPUs / 8 GiB, which its oracle needs.rollouts_failures.jsonlas a terminal failure, without retries.Oracle over the supported set
gym dataset validate terminal_bench_scienceover the 65 tasks outside the five Compose tasks, on the same OpenSandbox deployment and build record, with the preset's server settings (46800 s episode cap, 900 s setup, 1200 s ready, the three labels, 100 GiB disk,resource_requests: limits), concurrency 16:certified-sparse-regression(verifier 3138 s of 7200 s),finite-free-stam(137 s) andgen-turan-paths(581 s);linked-cell-suppression(654 s);/tasks (the oracle does not go through the mini-SWE seed);prlimit --nproc=64(EAGAIN):leaky-bloch-meep,navigation-sensor-calibration,small-area-equivalenceandtess-transit-vetting. A rerun of the four alone at concurrency 1 passednavigation-sensor-calibration(1.0, 65 s), and the other three failed the same way (see Known limits).longitudinal-clinical-agentandtamp-skill-planning: their sidecar images (broker,sim) were not available to the deployment.Checks
pre-commit run --files <changed files>: passed.Known limits
ode-law-discoveryandgeometric-pharmacophore-alignmentstart the agent in/, whichmini_swe_agentrefuses. Each is recorded as a terminal failure with no reward, so it is left out ofmean/rewardinstead of counting as 0. Count them as fails when you compare with the leaderboard, or run them withterminal_bench_science/codexorminiswe_legacy_agent.gym eval runandgym dataset validaterefuse to start unless they are excluded (or--skip-unloadableis passed togym eval run).inverse-lithographyuses unsupportedinit;noisy-blackbox-optimizationuses unsupportedinit,pids_limit,read_onlyandcap_drop;protein-active-learningrequests an unsupported internal network. These tasks produce no rollout/reward and are absent from the default denominator. The Harbor route does not apply the resources server's Compose overrides/ignored settings.longitudinal-clinical-agentandtamp-skill-planninghave no known Compose field rejection after image preparation but remain untested: their sidecar images were not available to the validation deployment.gym eval run terminal_bench_sciencewithout the preset keeps each package'sstorage_mb.leaky-bloch-meep,small-area-equivalenceandtess-transit-vettingscored 0 because the verifier could not fork the solver replay (EAGAIN) under its ownprlimit --nproc=64. They failed again alone at concurrency 1 (see Validation). The likely cause is the deployment:RLIMIT_NPROCcounts the UID's processes across the user namespace, so busy shared nodes can trip it. That has not been confirmed. These three are unvalidated here, not known to pass.[verifier.environment].network_mode, which would drop the 70 network overrides.🤖 Generated with Claude Code