Skip to content

Add TerminalBench 4.0 - #3366

Merged
bxyu-nvidia merged 34 commits into
mainfrom
flafrance/terminal-bench-4
Sep 17, 2026
Merged

bxyu-nvidia merged 34 commits into
mainfrom
flafrance/terminal-bench-4

Conversation

@lafrancef

@lafrancef lafrancef commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

TB4 integration

A couple small changes in nemo_gym/ proper to address some characteristics specific to TB4 (in particular, TB2.1 did not need these):

  • Sandbox TTL renewal for longer tasks. TB4 calls for 8h limit on tasks: this might be longer than the maximum TTL configured by the sandbox domain.
  • Helpers for shared volumes. TB4, unlike TB2.1, has a separate sandbox for verification. Shared volume allows us to avoid copying the agent artifacts around from the agent sandbox to the verifier sandbox.

Known limitations:

  • Some TB4 tasks require a GPU sandbox. Right now this is handled by allowing to pass different sandbox domains for CPU vs GPU. This is not general, but allows us to run the whole benchmark as one unit.

@copy-pr-bot

copy-pr-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

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

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

@lafrancef
lafrancef force-pushed the flafrance/terminal-bench-4 branch 2 times, most recently from 8b41d2f to ac92e3b Compare September 15, 2026 22:40
@lafrancef
lafrancef force-pushed the flafrance/terminal-bench-4 branch from b0d2f39 to faa32ca Compare September 17, 2026 13:53
Translate Harbor's static no-network policy into deny-all OpenSandbox egress for single-container environments. Keep public agent configuration intact and reject unsupported providers, Compose isolation, allowlists, and runtime policy switching.

Validation: 75 Harbor integration tests passed; both affected TB4 tasks completed capped model runs and official separate verification without Harbor exceptions. Live probes confirmed hostname/direct-IP blocking and artifact transfer. Document the deployment's IPv6 loopback limitation.
Signed-off-by: Frederic Lafrance <[email protected]>
Pass Compose shared-memory sizes to OpenSandbox create metadata, preserve explicit root UID zero, and retain declared ports across sandbox serialization and reconnection.

Validation: 113 targeted Compose, sandbox reconnect, and Harbor adapter tests passed. Ruff and diff checks passed.
Signed-off-by: Frederic Lafrance <[email protected]>
Add pinned TB4 resources with explicit session ownership, budgets, official
verification, persisted retries, and borrowed sandbox handoffs. Run OpenCode
and generic mini-SWE in their Gym agent servers, preserving existing clients.

Add lifecycle, cancellation, artifact, MCP, and configuration coverage plus
real smoke validation utilities and migration documentation.

Signed-off-by: Frederic Lafrance <[email protected]>
Extract the generic mini-SWE harness and pass it the existing sandbox directly. Keep the agent endpoint as a collector adapter, remove borrowing and handoff APIs, and retain task pinning, deadlines, result replay, collection, separate verification, and cleanup.

Signed-off-by: Frederic Lafrance <[email protected]>
The manifest source_commit is a Git revision, and the registry API key uses Supabase's intentionally public sb_publishable key type. Add only these exact findings to the existing baseline and mark them as non-secrets.

Signed-off-by: Frederic Lafrance <[email protected]>
@lafrancef
lafrancef force-pushed the flafrance/terminal-bench-4 branch from faa32ca to d2e9b69 Compare September 17, 2026 14:37
bxyu-nvidia
bxyu-nvidia previously approved these changes Sep 17, 2026
@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test d2e9b69

@lafrancef
lafrancef marked this pull request as ready for review September 17, 2026 20:28
@lafrancef
lafrancef requested a review from a team as a code owner September 17, 2026 20:28
@lafrancef

Copy link
Copy Markdown
Contributor Author

/ok to test 068db2a

@bxyu-nvidia
bxyu-nvidia merged commit ae6ddbb into main Sep 17, 2026
43 checks passed
@bxyu-nvidia
bxyu-nvidia deleted the flafrance/terminal-bench-4 branch September 17, 2026 21:04
bxyu-nvidia pushed a commit that referenced this pull request Sep 22, 2026
Follow up on #3366 to match Gym's agent/resources server pattern: the
mini-SWE agent owns setup, model calls, and the rollout loop; TB4
resources provisions `/seed_session` and grades and cleans up through
`/verify`.

- Seeded sessions have a resource-owned deadline, defaulting to 10 hours
from sandbox readiness. Abandoned sessions are cleaned up and release
their concurrency slots; late seed/verify requests receive HTTP 410.
`/verify` atomically transfers ownership to the verifier lifecycle, so
the seed deadline cannot interrupt grading. Configure the deadline with
`seeded_session_timeout_sec` or `tb4_seeded_session_timeout_sec`.
- Agent shutdown uses one `shutdown_timeout_sec` budget for completing
seeding and requesting cleanup. If the seed response remains blocked,
shutdown returns and resource-side expiry provides the cleanup fallback.
- Output-token truncation is forwarded to mini-SWE 2.4.6 so its native
“respond more concisely” reminder reaches the next turn after missing or
malformed tool calls.

The split preserves retry deduplication, session ownership, model-call
capture, and official grading after agent timeout/failure. Existing
top-level TB4 overrides remain supported. Direct `model_server`,
`harness`, and agent-timeout overrides move to the agent configuration.
Agent trajectories remain inside `tb4_jobs_dir` when configured, with
`tb4_agent_artifacts_dir` available for an explicit override. Persisted
session records advance to version 3. Changes are confined to TB4 and
its mini-SWE adapter.

Real smoke: `gpt-5.4-mini-2026-03-17`, `interleaved-vigenere`, two model
turns, 180-second agent cap. Both model calls returned HTTP 200;
official grading completed with reward 0 after the step cap, and all
resources were cleaned up. A separate real sandbox seeded with a
two-second deadline expired without grading, cleaned up its resources,
and released its concurrency slot. An earlier `html-js-filter` smoke
completed its agent turns but its browser verifier stalled and was
stopped; it is not counted as a completed end-to-end smoke.

---------

Signed-off-by: Frederic Lafrance <[email protected]>

This branch was previously deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants