Skip to content

feat(terminal_bench_science): run mini-SWE through Harbor and keep the /run relay preset as miniswe_legacy_agent - #5991

Merged
weijiac0619 merged 25 commits into
mainfrom
weijiac/n4p0-tbsci-miniswe
Nov 16, 2026
Merged

weijiac0619 merged 25 commits into
mainfrom
weijiac/n4p0-tbsci-miniswe

Conversation

@weijiac0619

@weijiac0619 weijiac0619 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What and why

terminal_bench_science/miniswe was still on the legacy_agent /run relay with the deprecated miniswe_sandboxed_agent. #5654 left it there "until it has a supported migration path". This PR moves it to the same route as terminal_bench_4/miniswe in #5697: a committed Harbor entry, environments/harbor/terminal_bench_science, run by mini_swe_agent through the generic harbor environment server. The preset names the entry with harbor_target (#5794).

  • The Harbor server owns each task sandbox, its Compose group and the separate verifier, and lends the task sandbox to mini-SWE's agent session.
  • Each row carries the official instruction.md, read from the task folder, and the task's own 8-hour agent budget.
  • The harness settings are unchanged: Harbor's built-in mini-swe-agent defaults (no step limit, 30 s per command, each task's 8-hour budget), with the same tbsci_max_steps, tbsci_step_timeout_sec and tbsci_agent_max_timeout_sec overrides.
  • --agent-type runs another harness on the same entry, so TB-Science needs no second task path per harness.

terminal_bench_science/codex stays 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.toml and a README, like terminal_bench_4.
    • [gym] declares type = "benchmark" and license = "Apache 2.0" (a license alone would make the split validation). allowed_agents stays open; both READMEs say only mini_swe_agent has been run on this entry.
    • The source is Harbor's package store, pinned by the digest benchmarks/terminal_bench_science/manifest.json already records for the resources server (sha256:91531bf5…), so both paths run the same 70 packages. gym dataset pull terminal_bench_science fetches the task folders (gitignored).
    • The entry overrides only verifier settings, the ones the resources server's presets apply ("Deviations from the packages"):
      • Timeouts. finite-free-stam and gen-turan-paths 1800 s, certified-sparse-regression 7200 s.
      • CPUs and memory. The 58 packages whose [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 which highdim-mediation-debiasing's reference solution loses its verifier.
      • Network. Every package denies its verifier all egress with [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.yaml sets harbor_target: terminal_bench_science and loads mini_swe_agent_sandboxed.yaml.
    • step_limit is ${tbsci_max_steps,0}, step_timeout is ${tbsci_step_timeout_sec,30}, and sandbox_runner_timeout_seconds is ${tbsci_agent_max_timeout_sec,28800}. Each task's own budget can only shorten the cap.
    • Harbor server settings:
      • The episode cap is 46800 s (++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: 1200 for 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).
      • The resources server's other two deployment settings, for every sandbox the server starts, the verifier's included: sandbox_resources_override.disk_gib: 100 (++tbsci_min_disk_gib; every package's storage_mb is at most 20 GiB, and OpenSandbox evicts a sandbox that writes past its limit) and sandbox_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.
    • The manifest has harbor_target, resources_server: null, agent_server: mini_swe_agent, datasets: [] and prompt_source: agent. Its version is 0.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.yaml keeps the previous /run preset unchanged as terminal_bench_science/miniswe_legacy_agent, with a deprecation note and lifecycle deprecated. This follows the *_legacy_agent naming 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.
  • Docs.
    • The benchmark README: the intro and "Profile" describe the Harbor preset (prompt, images, runtime, run budget, episode bound, verifier and deployment settings, Compose, model address, working directory). "Run" is split into the Harbor preset and the resources-server presets (Codex, relay). The Harbor run and validate commands pass --exclude-tasks inverse-lithography,noisy-blackbox-optimization,protein-active-learning, since gym eval run and gym dataset validate refuse a non-empty skip list (or take --skip-unloadable), and the README says to keep --concurrency within mini-SWE's 32 sessions. The "Measurement contract" names the three excluded Compose tasks and two root-workdir seed refusals. Gym's default mean/reward counts 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.
    • The entry README uses the same two commands and marks a direct 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.
    • The mini_swe_agent README lists the TB-Science Harbor folders under "Pairings and limits", says the three Compose tasks must be excluded, and its note on miniswe_sandboxed_agent now names only the /run preset.
    • The relay preset's descriptions name its adapter and relay: mini-SWE 2.4.6's own agent loop, run by miniswe_sandboxed_agent over the legacy_agent /run relay.
    • "Integrate existing agents" says the TB-Science mini-SWE preset has migrated and its /run preset remains as miniswe_legacy_agent.
  • Tests.
    • New: test_miniswe_profile_runs_the_harbor_entry_with_mini_swe checks that harbor_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.
    • New: test_the_terminal_bench_science_entry_pins_its_digest_and_overrides_only_verifiers checks that the entry's source matches manifest.json, that it declares type = "benchmark" and its license, that it has no environment or artifacts overrides, the three timeouts, the 70 network moves and the 58 sized verifiers.
    • The relay tests load miniswe_legacy_agent.yaml. test_current_benchmark_manifests_match_runtime_composition also covers terminal_bench_science/miniswe_legacy_agent.

Pre-flight checks against the 70 pinned v0.1 packages (task.toml and environment/Dockerfile at tag v0.1.0):

  • No task sets [agent].user, which mini_swe_agent refuses. No agent Dockerfile sets USER.
  • Every agent budget is 28800 s; the slowest verifier allows 12000 s.
  • No task requests a GPU (65 CPU tasks and 5 Compose tasks), declares MCP servers or ships skills.
  • No task declares a prebuilt image: agent, verifier and sidecar images are built from the packages (builds.repository).
  • Two tasks, ode-law-discovery and geometric-pharmacophore-alignment, set no WORKDIR, so their agent starts in /. mini_swe_agent refuses a working directory that contains its session directory, so both fail at seed (see Known limits).

Compatibility

  • gym eval run --benchmark terminal_bench_science/miniswe keeps its name and the tbsci_* harness overrides, but now:
    • needs gym dataset pull terminal_bench_science instead of gym eval prepare, and the task images built and recorded (or prepared with a build tool).
    • runs on the Harbor environment server instead of the TB4 resources server, so the resources server's own settings (tbsci_split_sandbox_endpoints, tbsci_sandbox_model_base_url, tbsci_jobs_dir, the Compose service overrides) no longer apply to it.
    • needs no PyPI access in the sandbox: the runtime is uploaded from the agent server.
    • captures model calls but no token IDs or logprobs, which mini_swe_agent does not wire up. The /run profile captured training tokens.
    • selects the pinned 70-task dataset, but needs the three unsupported Compose tasks excluded (--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 version 0.2.0, see Known limits).
    • reports mini_swe_termination instead of miniswe_termination.
  • The previous behavior is available as --benchmark terminal_bench_science/miniswe_legacy_agent, with the same rows, settings and outputs as before.
  • terminal_bench_science/codex and the TB4 resources server are unchanged.

Additional review and validation

The re-review at b32b03e1 is addressed in 72c9e5c403801d3b675006811ecff63a1933580b:

  • the run and validate commands exclude the three Compose tasks;
  • the entry README points at the benchmark;
  • the preset carries the 100 GiB disk, resource_requests: limits and a 300 s close timeout;
  • the entry declares type and license;
  • the preset test keeps only the composition check;
  • the relay preset's descriptions name its adapter and relay.

On that commit, the unit tests and pre-commit pass (see "Unit tests"). The 65-task oracle under "Validation" ran with the same preset settings.

Main 6096dafbc9721044e7c21edfaa736e9361717d59 (#5697) was merged in b32b03e1430bd5908978c3b04ba9405dd6148027 to 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 from bec8aee3, 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 unsupported git 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 bec8aee36f0432799cf96938cbf39375a8d8e009 changes the benchmark README, Harbor-entry README and manifest description. It does not change runtime code or configuration.

  • At c00c56da85ae490031294b3a4584e3752fe11dea, 57 focused tests passed: the new Harbor-entry test, the three current TB-Science manifest cases, and tests/unit_tests/cli/test_eval_harbor_benchmark.py. A separate probe composed the actual shipped preset through harbor_benchmark, build_run and the config parser, checking defaults, overrides, routing and sandbox labels.
  • The affected mini-SWE manifest case passed again after its description changed. Full pre-commit run --all-files passed on the final repair tree b7407f679f1736085c45d47d120015afa50d93e0 without modifications. All verification ran on the workstation; no dependencies were installed.
  • Source review compared the five Compose definitions at upstream f81afac4f11048e77a15dfc8fb1dbfb897fea0ce with the current preparation validator. It established the three refusals above; no full 70-package materialization or Compose execution was performed.
  • Scoring review confirmed that recognized verifier timeout/missing/invalid-reward outcomes are measured zeros on both routes when agent infrastructure failures do not take precedence. Harbor preserves a valid reward written before verifier timeout and verifies incomplete/killed mini-SWE runs. CTRF counts and partial_credit are projected only by the resources-server presets.
  • The real runs below are author-reported current-Harbor evidence. Their original source SHA and raw artifacts were not supplied for independent inspection. No model run was repeated for the documentation-only correction.

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 for terminal_bench_science/miniswe_legacy_agent and terminal_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.

  • Oracle. gym dataset validate terminal_bench_science on the six tasks: every reference solution scored 1.0, each graded in its own verifier sandbox with the no-network policy.
  • mini-SWE. gym eval run --benchmark terminal_bench_science/miniswe ++tbsci_agent_max_timeout_sec=1800 with concurrency 6. The model was a Nemotron checkpoint served by vLLM. The agent was capped at 30 minutes, with no step cap.
Task Oracle (verifier) mini-SWE reward Tests mini-SWE exit Model calls Time
variable-star-vetting 1.0 (35 s) 0 4/6 completed 79 1786 s
neo-orbit-determination 1.0 (31 s) 0 2/4 timeout (30 min cap), graded 61 2082 s
mendota-ice-phenology 1.0 (33 s) 0 0/4 timeout (30 min cap), graded 102 2092 s
highdim-mediation-debiasing 1.0 (282 s) 0 5/10 completed 58 1478 s
ode-law-discovery 1.0 (61 s) none - refused at seed (workdir /) 0 12 s
geometric-pharmacophore-alignment 1.0 (42 s) none - refused at seed (workdir /) 0 10 s
  • Graded tasks. The four ran harness setup, the uploaded runtime, the agent, the separate no-network verifier and cleanup. None was masked or an infrastructure error. The capped runs were graded with mini_swe_termination: timeout.
  • Verifier sizing. highdim-mediation-debiasing's verifier ran at the agent's 4 CPUs / 8 GiB, which its oracle needs.
  • The refused tasks. Both were refused at seed with HTTP 422 ("mini-SWE needs an absolute task workdir disjoint from its session directory"). Gym recorded each once in rollouts_failures.jsonl as a terminal failure, without retries.
  • No Compose task was run. No sidecar images were available to the deployment (see Known limits).

Oracle over the supported set

gym dataset validate terminal_bench_science over 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:

  • Run health. 65/65 rollouts final, none failed. Every sandbox started, and none was evicted.
  • 61 scored 1.0. These include:
    • the three timeout overrides: certified-sparse-regression (verifier 3138 s of 7200 s), finite-free-stam (137 s) and gen-turan-paths (581 s);
    • linked-cell-suppression (654 s);
    • both workdir-/ tasks (the oracle does not go through the mini-SWE seed);
    • every resized verifier in this set.
  • 4 scored 0, all because the verifier could not fork the solver replay under its prlimit --nproc=64 (EAGAIN): leaky-bloch-meep, navigation-sensor-calibration, small-area-equivalence and tess-transit-vetting. A rerun of the four alone at concurrency 1 passed navigation-sensor-calibration (1.0, 65 s), and the other three failed the same way (see Known limits).
  • Not run. longitudinal-clinical-agent and tamp-skill-planning: their sidecar images (broker, sim) were not available to the deployment.

Checks

  • pre-commit run --files <changed files>: passed.
  • DCO sign-off on every commit; GPG signatures on the author's commits.

Known limits

  • Two of the 70 tasks are refused at seed. ode-law-discovery and geometric-pharmacophore-alignment start the agent in /, which mini_swe_agent refuses. Each is recorded as a terminal failure with no reward, so it is left out of mean/reward instead of counting as 0. Count them as fails when you compare with the leaderboard, or run them with terminal_bench_science/codex or miniswe_legacy_agent.
  • Three Compose tasks must be excluded. Preparation skips them, and gym eval run and gym dataset validate refuse to start unless they are excluded (or --skip-unloadable is passed to gym eval run). inverse-lithography uses unsupported init; noisy-blackbox-optimization uses unsupported init, pids_limit, read_only and cap_drop; protein-active-learning requests 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-agent and tamp-skill-planning have no known Compose field rejection after image preparation but remain untested: their sidecar images were not available to the validation deployment.
  • Disk. The preset raises every sandbox's disk to 100 GiB, as the resources server does. A direct gym eval run terminal_bench_science without the preset keeps each package's storage_mb.
  • Three verifiers fail their fork on our OpenSandbox deployment. In the 65-task oracle, leaky-bloch-meep, small-area-equivalence and tess-transit-vetting scored 0 because the verifier could not fork the solver replay (EAGAIN) under its own prlimit --nproc=64. They failed again alone at concurrency 1 (see Validation). The likely cause is the deployment: RLIMIT_NPROC counts 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.
  • The verifier network policy needs OpenSandbox. A follow-up could let the loader apply a separate verifier's own [verifier.environment].network_mode, which would drop the 70 network overrides.
  • The mini-SWE smoke is a lifecycle check, not a score. It ran 6 tasks, one rollout each, under a 30-minute cap. No score parity with the relay is claimed.

🤖 Generated with Claude Code

weijiac0619 and others added 9 commits November 5, 2026 15:28
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]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

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]>
@weijiac0619
weijiac0619 marked this pull request as ready for review November 11, 2026 03:53
@weijiac0619

Copy link
Copy Markdown
Contributor Author

/ok to test 206f282

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.py line 933: BLOCKER — Preserve the killed-agent zero when decoding mini-SWE responses

    The migration makes this unchanged conversion wrong for mini-SWE. A runner killed mid-step returns status="incomplete" with mini_swe_termination="killed" (adapter). This branch converts that to timeout, so TB4 runs the verifier and can award credit. Previously, the relay passed reason="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_response with 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 as timeout; retain all existing response-status conversion cases.

  • benchmarks/terminal_bench_science/miniswe.yaml line 43: RISK — Retain the official eight-hour ceiling above configurable smoke caps

    With ++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.yaml line 32: RISK — Keep the full-task preset working until root-workdir tasks can migrate

    The 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-discovery and geometric-pharmacophore-alignment consequently 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/miniswe preset 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 /app task, 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]>
@weijiac0619

Copy link
Copy Markdown
Contributor Author

/ok to test cb0a46f

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

miniswe/manifest.yaml:7

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

miniswe.yaml:5-6

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

miniswe.yaml:44

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_concurrency above 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: 60 bounds 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 --concurrency above 32, queued episodes spend their budget waiting, and a later full 8-hour run can end in harbor:task_deadline and be retried. tbsci_concurrency doesn'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 retryable dependency_failure. codex.yaml uses 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}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

miniswe.yaml:58

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mini_swe_agent/README.md:75

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

weijiac0619 and others added 5 commits November 12, 2026 22:14
…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]>
…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]>
@yaoyu-33
yaoyu-33 requested a review from prokotg November 14, 2026 00:04
…rbor preset

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

Copy link
Copy Markdown
Contributor

/ok to test c00c56d

@weijiac0619 weijiac0619 changed the title feat(terminal_bench_science): run the mini-SWE preset through mini_swe_agent sessions and keep the relay preset as miniswe_legacy_agent feat(terminal_bench_science): run the mini-SWE preset on the Harbor environment server and keep the relay preset as miniswe_legacy_agent Nov 14, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test bec8aee

@yaoyu-33 yaoyu-33 changed the title feat(terminal_bench_science): run the mini-SWE preset on the Harbor environment server and keep the relay preset as miniswe_legacy_agent feat(terminal_bench_science): run mini-SWE through Harbor and retain the legacy preset Nov 14, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test b32b03e

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-network from [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_s and sandbox_metadata are 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.yaml don't carry over.
  • Oracle validation covers only 6 of the 65 runnable tasks.
  • A few smaller notes. The concurrency / session_close_timeout_seconds point 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.

Comment on lines +511 to +512
gym dataset pull terminal_bench_science
gym eval run --benchmark terminal_bench_science/miniswe --sandbox opensandbox \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

README.md:511-512

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.

Suggested change
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 \

Comment on lines +12 to +13
gym dataset validate terminal_bench_science --sandbox opensandbox
gym eval run terminal_bench_science --agent mini_swe_agent/mini_swe_agent_sandboxed --sandbox opensandbox \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

README.md:12-13

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?

Comment on lines +35 to +38
sandbox_metadata:
nemo.nvidia.com/resources: custom
nemo.nvidia.com/oom-kill: process
nemo.nvidia.com/s3-hostpath: 'false'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

miniswe.yaml:35-38

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 to PROVIDER_UNAVAILABLE (provider.py#L2526-L2537), so the episode is retried and then left out of mean/reward. The resources server scores the same death as 0, so this pushes the Harbor mean up. sandbox_resources_override replaces 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-regression already needed 4002 s on 4 CPUs.

Same gap in TB4's preset on main.

Suggested change
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dataset.toml:10

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]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dataset.toml:5

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.

Suggested change
[gym]
[gym]
type = "benchmark"
license = "Apache 2.0"

memory_mb = 4096
network_mode = "public"

[gym.tasks."ode-law-discovery".verifier]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dataset.toml:366

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +7 to +8
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

manifest.yaml:7-8

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.

Suggested change
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]>
@yaoyu-33
yaoyu-33 requested a review from gchlebus November 16, 2026 00:15
@weijiac0619 weijiac0619 changed the title feat(terminal_bench_science): run mini-SWE through Harbor and retain the legacy preset feat(terminal_bench_science): run mini-SWE through Harbor and keep the /run relay preset as miniswe_legacy_agent Nov 16, 2026
@yaoyu-33
yaoyu-33 removed the request for review from sephmard November 16, 2026 04:26
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test 72c9e5c

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 16, 2026 04:36

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit a6c0261 Nov 16, 2026
66 of 68 checks passed
@weijiac0619
weijiac0619 deleted the weijiac/n4p0-tbsci-miniswe branch November 16, 2026 05:08
gwarmstrong added a commit to gwarmstrong/Gym that referenced this pull request Dec 2, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants