Why the hardest test for AI agents is not what they can solve, but how long they can keep going.


The Stamina Problem

Ask a frontier LLM to fix a failing test. It usually can. Ask it to spend 90 minutes reproducing a scientific experiment, debugging a compiler toolchain, or playing 2048 move by move. Something different happens. The model does not lack knowledge. It loses the thread.

State drifts. Earlier decisions get forgotten. Exploration turns into looping. The budget burns down with the goal half-reached. This is not a reasoning failure. It is a stamina failure.

A new benchmark from Tencent HY LLM Frontier, published July 13, 2026, on arXiv as paper 2607.08964, measures exactly this regime. It is called Long-Horizon Terminal-Bench, or LHTB. It drops an LLM agent into a Docker container with a long-horizon goal and grades how far it gets before time runs out.

The results are sobering. The best model tested, Grok 4.5, solves 13 of 46 tasks at a 0.95 reward threshold. The mean pass rate across all 21 evaluated models is 6.4%. Twenty-nine of 46 tasks have never been solved by any model.

The benchmark is open source under Apache 2.0, with 138 GitHub stars, a dataset on Hugging Face, and a live leaderboard. It builds on the Terminal-Bench 2.0 formulation but extends it in two critical ways: longer tasks and denser grading.

arXiv paper | GitHub repo | Hugging Face dataset | Live leaderboard


What LHTB Actually Tests

LHTB consists of 46 tasks across nine categories. Each task runs in a containerized terminal environment. The agent receives a natural-language instruction and must complete the goal entirely from the command line. It issues shell commands, edits files, runs scripts, inspects outputs, and iterates. Hundreds of steps. Tens of minutes to hours of wall-clock time.

The nine categories cover a wide surface:

Category Tasks Examples
Interactive games and puzzles 8 2048, Sokoban, Super Mario, Chess
Multimodal and imaging analysis 6 Satellite flood detection, DICOM radiology audit
Software and reverse engineering 6 LangChain version migration, RISC-V core debug
Scientific computing and simulation 6 N-body acceleration, SU2 airfoil regression
Earth, climate, and energy 6 MODFLOW groundwater regression, MATPOWER OPF regression
Systems, performance, and security 5 DuckDB optimizer closure, PoC exploit craft
Research reproduction and ML 5 UNISON paper reproduction, Foldseek paper reproduction
APEX professional workflows 4 Investment banking matter, law433 matter
Logic and constraint puzzles varies Constraint satisfaction via search

No single category dominates. The largest is interactive games at 8 tasks. Even the largest category is only 7 of 46 in some breakdowns, so no single skill determines the mean.

The task mix includes Python (79.1% of the codebase), SystemVerilog (12.6%), Shell, Dockerfile, HTML, JavaScript, and C. This is not a pure coding benchmark. It tests whether an agent can sustain work across domains that require different feedback loops.


Dense Reward Grading: The Key Innovation

Most agent benchmarks grade on a single bit. Pass or fail. Solved or unsolved. This binary framing hides the difference between an agent that crashes on line one and one that gets 90% of the way there before timing out.

LHTB replaces binary grading with subtask-based dense rewards. Each task decomposes into a set of semantically meaningful subtasks. Each subtask gets a normalized score between 0 and 1. The overall task reward is a weighted aggregate.

Three types of subtasks exist:

Binary subtasks. Strict Boolean checks. Did all unit tests pass? Does the service respond on the expected port? Did the experiment script run without error? These return 0 or 1.

Continuous or thresholded subtasks. For quantitative targets like reproducing a figure or matching a metric. A score of 1.0 means the reproduced metric is within tolerance. The score decreases linearly toward 0 as error grows. This gives meaningful partial credit when an agent gets close but not perfect.

Episode-aggregating subtasks. For campaign-style tasks like games or repeated audits. The score is the fraction of episodes or levels where the success flag triggers. This measures whether an agent can perform reliably across many trials, not just succeed once by chance.

The overall task reward R determines whether a task counts as solved. The threshold is R >= 0.95 for "solved" status. The benchmark also reports mean R across tasks to capture how far agents progress on problems they cannot fully solve.

This dense grading is what makes LHTB informative at current capability levels. Under a strict perfect-score threshold (R = 1.0), ten of the 21 models solve zero tasks. Their partial progress would be invisible under binary scoring. Dense rewards spread that mass out and make the ranking meaningful.


The Scale of One Run

Running all 46 tasks once takes each model 53 to 71 hours of wall-clock time. A single task averages 69 to 93 minutes and 120 to 320 agent steps.

Averaged over the 46-task suite, each model run consumes:

  • 239 episodes (agent interaction turns)
  • 9.8 million tokens per task
  • 88.9 minutes of execution time per task

This is an order of magnitude more demanding than Terminal-Bench 2, which typically completes in 20 to 30 minutes with 20 to 30 episodes per task. The 90-minute timeout per task keeps partial credit. Whatever the hidden verifier can replay at the deadline counts.

The agents must hold a loop together for the full duration. Read a file. Write a script. Run it. Inspect the output. Adjust. Run again. Hundreds of times. Without losing the thread.


Evaluation: One Harness, 21 Models, No Special Treatment

Every model runs through the same Terminus-2 harness. Same prompts. Same parser. Same summarization policy. Same 90-minute budget per task. One attempt. No retries of bad runs. No model-specific tools. No bespoke agents.

The only difference is the API endpoint behind the harness. This controls for scaffolding effects. When one model outperforms another, the difference comes from the model, not the wrapper.

The benchmark evaluated 21 frontier models. Here is the full leaderboard:

Rank Model Vendor Mean Reward Solved (R >= 0.95) Cost/Task
1 Grok 4.5 xAI 0.505 13/46 $11.19
2 Claude Sonnet 5 Anthropic 0.497 8/46 $60.37
3 Claude Opus 4.8 Anthropic 0.492 9/46 $39.11
4 Claude Fable 5 Anthropic 0.487 12/46 $73.11
5 GPT-5.6 Sol OpenAI 0.451 7/46 $21.14
6 GPT-5.5 OpenAI 0.445 7/46 $21.46
7 MiniMax M3 MiniMax 0.385 3/46 $6.13
8 Claude Sonnet 4.6 Anthropic 0.373 4/46 $38.00
9 Kimi K2.7 Code Moonshot 0.367 3/46 $8.31
10 GLM 5.2 Zhipu 0.316 1/46 $11.93
11 Qwen3.6 Plus Alibaba 0.313 1/46 $4.47
12 DeepSeek V4 Pro DeepSeek 0.307 3/46 $6.32
13 Qwen3.7 Max Alibaba 0.296 2/46 $7.78
14 Hy3 Tencent 0.288 1/46 $2.47
15 Doubao Seed 2.1 Pro ByteDance 0.286 2/46 $5.16
16 Gemini 3.1 Pro Google 0.279 2/46 $7.61
17 GPT-5.4 OpenAI 0.272 1/46 $27.57
18 GLM 5.1 Zhipu 0.267 2/46 $5.13
19 Kimi K2.6 Moonshot 0.255 0/46 $9.94
20 GPT-5.3 Codex OpenAI 0.203 2/46 $8.20
21 Grok 4.20 xAI 0.080 0/46 $20.63

Source: GitHub README leaderboard table.


Five Findings That Matter

1. The frontier tops out below half credit

Grok 4.5 leads with a mean reward of 0.505. That is the best any model achieves. The spread from first to last is nearly 2.5x. This benchmark is far from saturated. There is no model that can reliably sustain work across these tasks. The best model solves 28.3% of tasks at the 0.95 threshold. The mean across all models is 6.4%.

2. Partial credit is what keeps the ranking alive

Only 7% of all 782 model-task runs cross the solve threshold. Under binary scoring, 93% of the benchmark would be indistinguishable zeros. The continuous reward spreads that mass out. More than half of all runs land in the low-partial band of 0 to 0.25, where models differ by how far they get before losing the thread. Flip to strict binary pass rate at R = 1.0 and the bars collapse. Ten of the 21 models solve zero tasks outright. The reward-order ranking no longer matches. The signal lives in the partial reward.

3. Price is not performance

Per-task spend ranges nearly 30x, from $2.47 (Hy3) to $73.11 (Claude Fable 5). Mean reward spans only 2.5x. Grok 4.5 posts the top mean reward at $11.19 per task. It lands top-left on the cost-versus-reward chart: best score and low cost at once.

MiniMax M3 scores 0.385 at $6.13 per task. It beats GPT-5.4 at $27.57 and Claude Sonnet 4.6 at $38.00. The Anthropic models pay the largest budgets ($38 to $73 per task) for scores that match or trail cheaper alternatives.

The efficient frontier moved. Cheaper models deliver 60 to 80% of the top score at a fraction of the cost. Price does not predict stamina.

4. Most failures are unfinished work, not immediate mistakes

Seventy-nine percent of unresolved runs time out while the agent is still actively making progress. The mean reward on these timed-out runs sits between 0.10 and 0.35. Agents accumulate partial progress but cannot close out the task.

This is the "completion cliff" that Daniel Vaughan identified in a detailed analysis of LHTB results. Across 15 frontier models and 46 tasks, 64.6% of runs make real partial progress. Only 4.3% cross the 0.95 reward threshold. The gap between "making progress" and "finishing" is the dominant failure mode.

Fourteen runs achieved R >= 0.75 but terminated early despite unmet hidden verification steps. The agents believed they were done. They were wrong. Kimi K2.7 stopped on a DuckDB optimizer task at R = 0.92. GLM 5.2 stopped on a materials task at R = 0.90. Twenty-plus minutes remained on the clock.

5. Twenty-nine of 46 tasks have never been solved

The unsolved frontier is large. Twenty-nine tasks remain unsolved by any model at the 0.95 threshold. Only 17 tasks have been solved by at least one model. The hardest tasks demand sustained quantitative feedback loops: run, measure, adjust, re-run. Or they require evidence extraction from non-text modalities like satellite imagery or DICOM radiology files.

The easiest tasks are those with legible feedback signals. spot-scheduler-traces has a mean reward of 0.96 across all models. nbody-accel-iterative sits at 0.93. When the agent can clearly see whether its last step worked, it can sustain progress. When the feedback signal is ambiguous or requires domain expertise to interpret, agents stall.


Why Existing Benchmarks Miss This

Existing terminal and software-engineering benchmarks have two structural blind spots that LHTB addresses.

Short horizons. SWE-Bench and Terminal-Bench 2 tasks typically finish within a few minutes to at most 30 minutes. They measure whether an agent can start work. They say nothing about whether the agent can sustain it. An agent that completes a dozen actions successfully looks identical to one that can hold a loop together for 300 steps.

Sparse grading. Outcome-only grading yields binary signals. An agent that completes most intermediate steps but fails at the final step gets the same score as one that fails from the beginning. This compresses the measurement range and hides meaningful differences between models.

LHTB targets both gaps. The tasks are long by construction. The grading is dense by design. Together, they expose a failure mode that short-horizon, binary-graded benchmarks cannot see: the agent that knows what to do but cannot keep doing it long enough.


Anatomy of a Task: UNISON Paper Reproduction

To understand what LHTB demands, consider one concrete task. In unison-paper-reproduction, the agent must reproduce an experiment from the UNISON paper (ACM, 2023) without being given the original implementation.

The instruction tells the agent to build a parallel simulation pipeline, run the fat-tree MTP experiment with specific parameters (k=4, 4 threads, seed 7), and match reference metrics: 232 flows, 6,254,916 events, and 14.46 Gbps throughput. The tolerance is tight.

The environment contains a skeleton project in /app. The agent must implement topology generation, logical process partitioning, deterministic execution, and scheduling from scratch.

The verifier runs six hidden checks. It tests metric fidelity against the reference numbers. It checks whether LP partitioning is non-trivial. It verifies same-seed determinism. It tests plausible behavior under hidden seeds the agent has never seen.

A deterministic pipeline that misses the target numbers still earns partial credit. The agent does not need to be perfect to score. It needs to make real, verifiable progress.

This is what every LHTB task looks like. A hard goal. A containerized environment. Hidden checks. Dense rewards for partial progress. And a time budget that forces the agent to work efficiently or run out of steam.


Failure Modes in Detail

The paper provides qualitative analysis of how agents fail on LHTB. The patterns are consistent across models.

State drift. Over hundreds of steps, the agent's internal model of the task state diverges from the actual container state. Files have been modified. Previous decisions are forgotten. The agent starts acting on stale assumptions.

Exploration loops. Agents repeat failed approaches without memory of having tried them. A model might attempt the same fix three times across a long session, each time forgetting the previous attempt failed for the same reason.

Premature stopping. Agents declare success before hidden verification steps are complete. They pass visible tests but miss held-out checks. The false-finish problem affects even strong models. Fourteen runs in the evaluation stopped early with R >= 0.75 and 20+ minutes remaining.

Budget blindness. Agents have no awareness of how much time or token budget remains. They spend freely early in the session and run out of resources before completing the task. The mean of 9.8 million tokens per task shows how expensive exploration is. Models that thrash consume more tokens and achieve less.

Context decay. At 9.8M tokens per task, early plans and observations get compacted away. The agent loses access to its own history. It must rediscover state it already computed. This is not a memory problem in the traditional sense. It is a context management problem at scale.


What This Means for Agent Development

LHTB reveals that the bottleneck for AI agents is not capability. It is stamina. The models know what to do at each local step. They cannot sustain coherent progress over hundreds of steps.

This has implications for how agent systems are built.

Context management is critical. Systems that compact context aggressively lose state. Systems that do not compact run out of context window. The balance between preserving critical state and discarding noise determines whether an agent can survive a long session.

Self-verification is necessary. Agents that stop early on incomplete work waste their remaining budget. A verification layer that checks whether the goal is actually achieved before declaring success would prevent false finishes. The 14 runs that stopped early at R >= 0.75 represent wasted potential.

Budget awareness helps. Agents that know how much time or tokens remain can adjust strategy. A model with 10 minutes left should consolidate partial progress, not start a new exploration path. The paper's finding that 79% of failures are timeouts with active progress suggests agents do not switch to consolidation mode soon enough.

Feedback signal quality matters. Tasks with legible feedback (spot-scheduler-traces at 0.96 mean reward) are solvable. Tasks with ambiguous feedback (robotics-slam-benchmark-repair at 0.03 best score) are not. Building agents that can extract clear signals from noisy environments is the next challenge.


The Bigger Picture

LHTB arrives at a moment when agent benchmarks are proliferating but most measure the wrong thing. SWE-Bench measures whether an agent can fix a bug. Terminal-Bench measures whether it can complete a short task. WebArena measures whether it can navigate a website. All of these are useful. None of them answer the question that matters for real deployment: can the agent keep working when the task is hard and long?

The answer from LHTB is clear. Current agents cannot. The best model solves 28.3% of tasks at a relaxed threshold. The mean across models is 6.4%. Twenty-nine of 46 tasks remain unsolved by anyone. There is substantial headroom for improvement.

The benchmark is open source. The dataset is on Hugging Face. The evaluation harness is available. The leaderboard is live. Anyone can run it. The tasks are contamination-resistant by design: hidden verifiers, deterministic seeds, and replay-based grading make memorization and shortcutting unprofitable.

The authors come from Tencent HY LLM Frontier, University of Maryland, University of Georgia, University of Minnesota, Indiana University, Lehigh University, National University of Singapore, and The Hong Kong Polytechnic University. The paper was submitted July 12, 2026, and posted to arXiv on July 13.

If you are building agents for real work, LHTB is the benchmark that tells you whether they can sustain it. Not whether they can start. Whether they can finish.


References

  1. Li, Z., Li, Z., Shi, Y., Wang, R., Yang, J., Liu, Z., Wu, X., Li, A., Yu, Y., Liu, N., Sun, L., Mi, H., Liang, L. (2026). "Long-Horizon-Terminal-Bench: Testing the Limits of Agents on Long-Horizon Terminal Tasks with Dense Reward-Based Grading." arXiv:2607.08964. https://arxiv.org/abs/2607.08964
  2. LHTB Project Page. https://zli12321.github.io/LHTB/
  3. LHTB GitHub Repository. https://github.com/zli12321/LHTB
  4. LHTB Hugging Face Dataset. https://huggingface.co/datasets/IntelligenceLab/Long-Horizon-Terminal-Bench
  5. LHTB Live Leaderboard. https://zli12321.github.io/LHTB/leaderboard.html
  6. Vaughan, D. (2026). "Long-Horizon-Terminal-Bench and the Completion Cliff." https://codex.danielvaughan.com/2026/07/15/long-horizon-terminal-bench-dense-reward-grading-codex-cli-goal-mode-token-budget-long-task-strategy/
  7. Merrill, D. et al. (2026). "Terminal-Bench: Benchmarking Agents on Hard Computer Tasks." Referenced in LHTB paper.
  8. Developers Digest. (2026). "Long-Horizon Terminal Bench Shows Why Coding Agents Still Stall." https://www.developersdigest.tech/blog/long-horizon-terminal-bench-agent-evals

Written July 17, 2026. Data from the LHTB paper, GitHub repository, and project page as of July 17, 2026.