Skip to content

Terminal-Bench 2.1 parity with tmax and OpenThoughts-TBLite eval - #459

Merged
pdasigi merged 9 commits into
mainfrom
terminal-bench-2.1-parity
Oct 12, 2026
Merged

pdasigi merged 9 commits into
mainfrom
terminal-bench-2.1-parity

Conversation

@pdasigi

@pdasigi pdasigi commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

Brings the Terminal-Bench external eval to parity with the implementation in shatu/tmax (omni_agent), pins it to Terminal-Bench 2.1, and adds OpenThoughts-TBLite on the same harness. tmax runs its evals through Harbor (the official Terminal-Bench runner) with a custom Vanillux2Agent; this PR ports the parts of that setup that determine the score and keeps this repo's own sandbox layer, which supports Podman natively instead of through Harbor's compose-over-socket shim.

Changes

  • Dataset pinned to Terminal-Bench 2.1 (harbor-framework/terminal-bench-2-1 at 7131e43). The loader also reads each task's CPU, memory and build settings.
  • New vanillux scaffold, the eval's default: a port of tmax's Vanillux2Agent. mini-swe-agent prompts, one bash tool in a persistent shell, submit marker, 64 steps, 10k-char head/tail output truncation, format-error recovery, and sampling at temperature 0.7 / top_p 0.95 / 16384 max tokens. openai_agents remains selectable.
  • Pristine task images. The derived swe-rex image no longer installs packages, prepends a venv to PATH, or leaves uv behind; the server is reached through a launcher symlink and the base image's USER is restored. Built for the base image's platform.
  • Resource limits and timeouts. Each container gets the task's --cpus/--memory (resource_limits=false to disable, needed on Beaker where Podman runs with cgroups disabled). The task's agent timeout now bounds the whole run; a timed-out agent is still verified, as Harbor does.
  • Attempts and error reporting. n_attempts gives pass@1, pass@k, pass_rate_std and pass_rate_sem. Harness failures (missing reward file, verifier timeout, container failure, model unreachable) are reported as error_rate and excluded from pass_rate_adjusted instead of silently scoring 0.
  • Robustness found by real runs: session commands that exceed their timeout are interrupted and returned as a result; bash syntax errors come back as bash's message; tool calls with malformed arguments are kept as text so vLLM does not reject the replayed conversation; the oracle runs as a streamed command so long solutions don't wedge the session; a 65536-id user namespace under Podman so apt-get works in task images.
  • OpenThoughts-TBLite (openthoughts_tblite): same harness, agent and metrics. Its tasks ship a Dockerfile instead of a prebuilt image, so each task image is built once per run from its environment directory, bounded by the task's build timeout and cached by content hash, with the swe-rex layer and registry caching on top.
  • Unit tests for the scaffold, loader, metrics, verifier, image build and executor changes; README sections for both evals.

Results: Qwen/Qwen3.5-9B, 5 attempts per task, one H100 on Beaker

vLLM 0.19.1 with tool_call_parser=qwen3_xml, max_model_len=65536, language_model_only=true, gdn_prefill_backend=triton. tmax reference numbers are from scripts/beaker/terminalbench_combined_evals.csv on the omni_agent branch (same model, same max length).

Terminal-Bench 2.1 (experiment, 89 tasks, 445 trials)

Metric This PR tmax
pass@1 0.204 ± 0.007 (SEM) 0.193
pass@5 0.360 0.360
pass@1 excluding infra-failed trials 0.207 0.219
error rate (tmax definition: agent timeouts + infra) 6.5% 16.2%
agent timeouts 23 (5.2%) ~20 (4.5%)
infrastructure errors 6 (1.3%) ~52 (11.7%)

OpenThoughts-TBLite (experiment, 100 tasks, 500 trials)

Metric This PR tmax
pass@1 (trial passes if reward > 0, tmax's rule) 0.456 0.432
pass@5 (same rule) 0.710 0.690
pass@1 (trial passes only at reward 1.0, this eval's reported metric) 0.408
pass@5 (same) 0.660
mean reward 0.444 ± 0.011
infrastructure errors 7 (1.4%) 11.6%

TBLite has partial-credit tasks (17 of 500 trials scored strictly between 0 and 1); tmax's compute_stats.py counts any positive reward as a pass, this eval counts only a full reward. Both conventions are shown above.

Why the error rate is lower

tmax's err_rate is computed from Harbor's exception table and includes AgentTimeoutError, so the comparable figure here is agent timeouts plus infrastructure errors. Agent timeouts match closely between the two (another sign the agents behave the same); the gap is in infrastructure failures, roughly 1% here versus roughly 12% in tmax. Based on tmax's own documentation of its Podman path:

  • Harbor drives Podman through a Docker-compatible socket and docker compose, with patches that tmax's docs describe as brittle: bind-mount permission failures that surface as RewardFileNotFoundError, flaky per-project networks, missing device nodes, and Docker Hub rate limits when co-located jobs pull images. This repo's sandbox talks to swe-rex over HTTP directly, supports Podman natively, reads the reward with an exec rather than through a bind mount, and builds each task's image once per job rather than re-pulling after compose down --rmi all.
  • The errors that remain here are all on tasks whose agent starts daemons, emulators, or CPU-bound scripts that outlive the per-command timeout and eventually take down the container's command server (install-windows-3.11, qemu-alpine-ssh, permutation-construction-100k, two server tasks). Harbor never sees this because every command is an independent exec.

Follow-ups

  • Prebuild and host the TBLite task images. Builds cost about 50 minutes of CPU per run spread across twelve slots (median 10s, p90 74s, max 7.4 min), so the saving is a few minutes per run; the real benefit is freezing dependency drift, which has already broken one Terminal-Bench reference solution upstream. Cheapest route is the existing SWEREX_REGISTRY cache with --gcp-credentials on the job; Docker Hub would need a publish script and an image mapping in the loader.
  • Kill session commands at their timeout (e.g. a timeout wrapper) or recreate the shell after a failed interrupt, which would remove most of the remaining infrastructure errors.
  • Decide whether pass@k should count partial credit as tmax does.
  • allow_internet=false cannot be enforced because swe-rex needs the network; every task in both datasets currently allows internet, and a warning is logged if that changes.

Test plan

  • uv run ruff check src/ tests/, uv run ruff format --check src/ tests/, uv run ty check src/ alembic/ (one pre-existing unused-ignore warning), uv run pytest tests/ --ignore=tests/integration (3216 passed).
  • Oracle smoke tests on Beaker for both datasets: Terminal-Bench 2.1 fix-git and adaptive-rejection-sampler both reward 1.0; TBLite acl-permissions-inheritance and broken-python reward 1.0, etl_checkpoint_resume_bug 0.0 due to its reference solution failing two of its own tests.
  • Full Qwen3.5-9B runs on both datasets, above.

🤖 Generated with Claude Code

https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ

pdasigi and others added 8 commits October 8, 2026 16:13
Pin the loader to the official terminal-bench-2-1 repository and read the
task resources it declares. Add the vanillux scaffold, a port of tmax's
Vanillux2Agent: mini-swe-agent prompts, one bash tool in a persistent
shell, head/tail truncation, format-error recovery, a submit marker and
the reference sampling defaults. Run each trial in a pristine task image
with the task's CPU and memory limits under its wall-clock agent timeout,
support several attempts per task with pass@k, and report harness
failures separately from zero rewards. Interrupt session commands that
exceed their timeout instead of failing the run.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
… of it

On a host of another architecture a derived image built with the default
platform gets an interpreter the base image cannot run. Read the base
image's platform and build for it. The pristine variant also removed the
uv binary after creating the virtualenv, so the image's own tools stay
the ones commands find.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
Rootless Podman's default namespace size leaves system ids such as nogroup
unmapped, which breaks apt-get in task images and verifier scripts.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
A solution that installs packages can take many minutes, longer than a
single swe-rex session request may last, which left the sandbox wedged
and the trial errored. Run it through the streamed background executor
the verifier already uses, and keep the agent cutoff to the agent path.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
A run that ends because the provider could not be reached is the
harness's failure, not the agent's, so it belongs in the error rate
rather than hiding as a zero reward.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
A command that fails swe-rex's syntax check now comes back to the model
as bash's error with exit code 2, as it would from a shell. A tool call
whose arguments are not a JSON object is kept as text in the replayed
conversation, since an OpenAI-compatible server rejects a conversation
that carries it as a tool call. Either case used to end the trial.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
TBLite ships a Dockerfile per task rather than a prebuilt image, so the
eval now builds a task's image from its environment directory when none
is declared, cached by content hash and serialized across attempts, and
layers swe-rex on top as before. The loader takes its repository, ref and
version as parameters, and the eval reads them from a dataset descriptor
that the TBLite subclass overrides. Difficulty and category labels are
normalized so the per-group metrics do not split on spelling.

The pristine swe-rex layer keeps its virtualenv outside any home
directory and hands control back to the base image's user, so tasks that
run as a non-root user do so here as well.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Sx2zb6N7vQiyaXL3C28fQ
@pdasigi
pdasigi requested a review from a team as a code owner October 10, 2026 14:23
@pdasigi
pdasigi enabled auto-merge (squash) October 12, 2026 22:38
@pdasigi
pdasigi merged commit 7874e56 into main Oct 12, 2026
7 checks passed
@pdasigi
pdasigi deleted the terminal-bench-2.1-parity branch October 12, 2026 22:45
gregorybchris added a commit that referenced this pull request Oct 13, 2026
Resolve conflicts with #459 (Terminal-Bench 2.1 parity):
- executor: keep main's interrupt_session handling of timed-out session
  commands, which replaces this branch's equivalent change.
- image: keep main's pristine mode and platform detection, and apply this
  branch's time budget to every subprocess image resolution runs, including
  the new base-image pull for platform detection. remove_swerex_image and the
  tag hash account for pristine.
- README: keep both the SWE-bench and Terminal-Bench sections.
- pyproject/uv.lock: main's dev extras plus swebench; lock regenerated.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris gregorybchris mentioned this pull request Oct 13, 2026
8 of 12 tasks
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