feat: add Terminal-Bench 4.0 as a separate Modal-backed benchmark - #72
feat: add Terminal-Bench 4.0 as a separate Modal-backed benchmark#72abhinav-pola wants to merge 6 commits into
Conversation
Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
Original prompt from Abhinav
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ndbox lifetimes Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
…n, and root-user deviation metadata Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
…a task images build Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
TL;DR
Adds
terminal_bench_4(Terminal-Bench v4.0.0, 55 single-container tasks, 3 of them on Modal H100s) as a new benchmark alongside the unchangedterminal_bench(2.1).What changed?
harbor/sandbox.ts,harbor/modal-sandbox.ts:CreateSessionInputgains optionalgpuandenv, forwarded toclient.sandboxes.createasgpu/env. Existing callers are unaffected (both optional, dropped viadefinedValues).terminal-bench-4/schema.ts: Zod schema for the 4.0task.tomlshape, validating only the fields the harness consumes (agent.timeout_sec,verifier.{timeout_sec,environment_mode,environment,collect,env},environment.{cpus,memory_mb,storage_mb,gpus,gpu_types,allow_internet,env},artifacts,metadata.category).environment_modemust be"separate".terminal-bench-4/tasks-source.ts: pinned checkout ofharbor-framework/terminal-benchat452bf305(thev4.0.0tag), override viaBENCH_TERMINAL_BENCH_4_TASKS_DIR.terminal-bench-4/dataset.ts: streamsterminal_bench_4-<taskId>samples, excludes the 11 docker-compose tasks, mapsgpus/gpu_typesto a Modal gpu string (toModalGpu:"H100","A100:2", throws when a GPU count has no type), carries agent and verifierSandboxResources,artifacts,collecthooks in sample metadata.terminal-bench-4/session.ts: two-sandbox flow. Agent sandbox (task image, task resources, GPU, internet forced on) runs the ori agent, thencollecthooks. Artifacts (/logs/artifactsplus declared paths) are tarred, downloaded, uploaded into a fresh verifier sandbox (verifier image, verifier resources and env) and extracted at the same absolute paths./tests/test.shruns, reward read from/logs/verifier/reward.txt.terminal-bench-4/solver.ts,benchmark.ts,images.ts: solver wiring, benchmark definition (temperature 0, 1 epoch,degradeSolverErrors: true, reuses the terminal-bench scorer), deterministic image tags<imageRepo>/<task>:<commit12>and<imageRepo>/<task>-verifier:<commit12>.benchmark-config.ts,benchmark-meta.ts,registry.ts,cli/index.ts:TerminalBench4OptionsSchema = TerminalBenchOptionsSchema.extend({ imageRepo }), meta, registry and CLI entries.scripts/build-terminal-bench-4-images.ts: one-offdocker buildx build --platform linux/amd64 --pushof agent and verifier images for every runnable task (--repo,--task,--concurrency,--dry-run).terminal-bench-4/README.md: provenance, license (Apache-2.0), execution model, GPU mapping, image strategy, the 11 excluded compose tasks.Why?
Terminal-Bench 4.0 is a different task set from 2.1 with separate verifier containers, Dockerfile-only environments and H100 tasks, so it cannot be a version bump of the existing integration. Requested in Slack by @abhinav-pola.
How to test
Deterministic (no network):
bun test src/benchmarks/terminal-bench-4Against the pinned checkout (clones once, or point at an existing checkout):
BENCH_TERMINAL_BENCH_4_TASKS_DIR=/path/to/terminal-bench@452bf305 bun test src/benchmarks/terminal-bench-4Expected: the pinned-checkout tests report 55 runnable tasks, 11 compose tasks, and exactly
fp8-rmsnorm-gemm,jax-speedrun-gpu,math-eval-gradermapped toH100.Image build dry run:
A real run (
bun run bench --benchmark terminal_bench_4 --model <model> --limit 20 --concurrency 4) has not been executed. It needs the 110 task images pushed to a registry and Modal credentials, neither of which was available in this session. See Reviewer focus.Benchmark impact
New benchmark only.
terminal_bench(2.1) code paths are untouched apart from two new optional fields onCreateSessionInputthat it does not set.A
terminal_bench_4score covers 55 of the 66 official tasks, so it is not an official Terminal-Bench 4.0 number. The README states this.Reviewer focus
DEFAULT_TERMINAL_BENCH_4_IMAGE_REPOisghcr.io/openrouterteam/terminal-bench-4. This is an assumption, not a confirmed registry. Change it or override withimageRepoin the run config.storage_mbis parsed and validated but not passed to Modal becauseSandboxCreateParamsin modal 0.8.0 has no disk-size field.jax-speedrun-gpudeclares 1 TB.allow_internet = falserecordagentNetworkForced: truein metadata rather than being blocked.collecthooks that name a compose sidecarservicefail the sample explicitly instead of being skipped.Checklist
Link to Devin session: https://openrouter.devinenterprise.com/sessions/646dc7c269b049f888a62b6003dacd62
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/646dc7c269b049f888a62b6003dacd62?variant=devin