LH-Harness

LongHorizon-Harness

Advancing Long-Horizon Agents for Real-World Tasks

Existing harnesses keep a whole long-horizon task in one continuously growing session, where step-level execution competes with long-term coordination and progress is judged inside the session that produced it. LongHorizon-Harness keeps the task state as an explicit record outside execution, admits only independently verified facts, and derives each next subtask from that record — a Manage–Execute–Audit (MEA) loop of independently audited state transitions.

Backend-independent A different model per role, by configuration alone

Claude Code, Codex CLI, Gemini CLI and mini-SWE-agent can each back any of the three roles, with a different model per role, assigned by configuration alone.

uv tool install lh-harness

Needs Python 3.10+ and one agent runtime on PATH: claude, codex or openclaw.

lh-harness run --task "Summarise the files in this directory." \
  --agent claude_code --model qwen3.7-plus --max-rounds 2

Add --dashboard to watch the MEA loop live, or --task @task.md to read from a file. Each run is isolated under runs/<run-id>/ with its audit trail.

Same backbone · Qwen 3.7-Plus

Swapping only the harness — same model, same execution backend — moves all three benchmarks in the same direction. On WeaveBench the result is nearly double the best officially reported configuration of any model.

  1. WeaveBench PassRate 51.8 80.7% +28.9
  2. Terminal-Bench 2.1 Success rate 69.7 77.2% +7.5
  3. OSWorld 2.0 Binary completion 2.8 8.3% 3.0×

Baseline versus LongHorizon-Harness on one shared 0–100 axis. PassRate counts tasks scoring ≥ 0.8.

Overview

A task solved end to end, the results, and one command to run it.

Core Idea

Keep the goal fixed; ground every decomposition in audited facts.

A long-horizon task is ultimately solved as a series of subtasks, yet the right decomposition cannot be fixed in advance: the next subtask depends on what has actually happened in the environment so far. LongHorizon-Harness therefore replaces the single growing session with a loop over three separated roles, so the task is decomposed dynamically and every decision is grounded in independently verified facts rather than self-reports.

Compounding errors

An early mistake distorts every choice made after it, and the agent drifts away from the goal it started with.

Context rot

As the history grows, what matters gets harder to retrieve, and performance falls off sharply once context use crosses a threshold.

Task-state loss

No accurate record of what is done, what was produced, and what the environment actually contains, so progress cannot be resumed.

Once an unverified premise enters the record, every later decision inherits it.

Existing harnesses never separate progress assessment from execution: a subagent reports a summary of its own work, and review is an optional action rather than a mandatory gate. Unverified premises accumulate and lead to repeated attempts, goal drift, or premature termination. An audit gate removes that failure at its root.

Two panels side by side. Left: a single growing session coils back on itself, judging its own progress, and drifts. Right: a manager re-plans the next subtask from audited facts, a fresh-context executor performs it, and a read-only auditor certifies what actually changed.
Audited state transitions. Instead of one continuously growing session that judges its own progress, a manager re-plans the next subtask from audited facts, a fresh-context executor performs it, and a read-only auditor certifies what actually changed in the environment. Audit reports are the only cross-round memory.
Left panel · today

One session, judging itself

Execution, task state and completion assessment share a single context that only grows. The agent's own summary is the record, so an unverified claim is indistinguishable from a fact and every later step inherits it. What the drawing shows as a coil is exactly that: motion without a fixed reference to check against.

Right panel · ours

Three roles, one audited record

The task state lives outside execution and is written only by the auditor, from the environment. The manager re-plans against that record, the executor works one subtask in a fresh context and discards it, and each round leaves behind an audit report rather than a transcript. Any backbone can fill any of the three roles.

P1 · Dynamic decomposition, fixed goal

Every round, the manager reads what has been verified as done, which constraints remain active, and what is still missing, then derives the next subtask with its target, dependencies, boundaries, and acceptance criteria.

P2 · Audit-grounded progress

Only a read-only auditor can update the record. It inspects the real environment after each round and never sees the executor’s reasoning or self-assessment, so a fact is completed only when an audit report cites it.

P3 · Round-local execution

A fresh-context executor performs the single current subtask and discards its context afterwards. Only compact audit reports cross rounds, so dense step-level observations never reach long-term coordination.

P4 · Reset without amnesia

An execution error is either exposed by the next audit or never enters the record, so it stays confined to its round. The audit report separates what remains trustworthy from what must be repaired.

Method

Three structurally isolated roles, one audited state machine.

LongHorizon-Harness preserves the native agent loop of existing systems. A lightweight AgentAdapter lets Claude Code, Codex CLI, OpenClaw and Hermes Agent serve as interchangeable backends for all three roles, spanning models such as Claude Opus, GPT and Qwen. Each role has its own budget: 1800s per round for the executor, 300s for the manager and auditor, under a cap of 25 MEA rounds per task.

Overview of LongHorizon-Harness: the manager emits a subtask contract, the executor performs the state-changing action in a fresh context, and the auditor appends a read-only report to the chain.

Read-only integrity

Auditing is restricted to read-only interaction, so verification cannot alter the result under inspection. The harness monitors task-relevant artifacts and workspace contents while an audit runs; if the auditor modifies protected state, its report is marked an integrity violation and can no longer support a completed record.

Manager

Keeps the task state: every requirement, artifact and environment fact, each marked completed, pending, blocked or untrusted, together with the audit evidence behind that status. A record becomes completed only when an audit report supports it. Each round it reads that state and decides whether to run another subtask, finish, declare the task blocked, or ask the user.

Executor

The only module allowed to change the environment. It receives one subtask and the evidence that subtask depends on, and starts from a fresh context every time; its raw trajectory and reasoning are discarded afterwards. Whether it works through the GUI or the command line follows the change being made, not what tools it happens to hold.

Auditor

Checks the result independently, from a context that never sees the executor's trajectory or reasoning. It may follow the executor's report to find the outputs, but it decides completion by inspecting the environment itself against the acceptance criteria, and records what it verified, what is still unresolved, and the evidence for each conclusion.

MEA Loop

Round i: manage, execute, audit.

Each round applies three operators in sequence: state transition (manage), state-changing action (execute), and state capture (audit). The auditor’s report from round i feeds the manager’s decision in round i+1, which in turn shapes the executor’s context in that same round.

Manage sees every report, never the environment
Manager reads the record

Takes the original task, the current task state, and every audit report gathered so far.

Apply the verified findings

Confirmed changes add or update requirement, artifact and fact records; anything unresolved stays pending, blocked or untrusted. Nothing is marked completed without audit evidence.

Emit one contract

Picks an unresolved objective reachable from the current state and bounds it: goal, acceptance criteria, boundary constraints, and the prior audit evidence relevant to doing and checking it.

Execute the only writer, fresh context each round
Executor acts, then forgets

Starts from a fresh context holding only what this round supplies, changes the environment, and reports what it did. Its raw trajectory is then discarded.

Audit read-only, independent of the executor
Auditor captures the state

Inspects the environment through read-only tools against the contract's criteria. The executor's report may guide where to look, but cannot establish completion.

Continue, or stop

The manager returns done when the audited state satisfies the task, blocked when nothing feasible advances it, ask when it needs user input, otherwise execute with the next contract, up to 25 rounds.

Benchmarks

Three long-horizon benchmarks, three axes of difficulty.

We evaluate LongHorizon-Harness on WeaveBench, OSWorld 2.0, and Terminal-Bench 2.1, covering cross-interface coordination, long-horizon state management under realistic professional complexity, and pure CLI competence. Our runs use Qwen 3.7-Plus as the primary backbone and Claude Opus 4.7 for the backbone-generality study.

WeaveBench weavebench.github.io ↗ OSWorld 2.0 osworld-v2.xlang.ai ↗ Terminal-Bench 2.1 tbench.ai ↗
Scale 114 tasks across 8 domains 108 tasks, median 1.6 h for a human Hard CLI tasks, 3 runs each
Interface GUI and CLI in one trajectory Desktop GUI, 1920×1080 CLI only — no visual perception
Scoring Trajectory-aware agentic judge; PassRate counts tasks scoring ≥ 0.8 Native env.evaluate(); binary and partial Per-task pass/fail, averaged over runs
Environment Containerized VM, frozen snapshot, restricted network Official osworld-v2-2026.06.24 Docker VM Harbor on the Docker backend
What it tests Whether evidence gathered in one interface survives into another Whether task state survives an hour-long professional workflow The state-management layer alone, with GUI routing removed
Results

Consistent gains across benchmarks and backbones.

With the same backbone and the same execution backend, LongHorizon-Harness lifts WeaveBench PassRate from 51.8% to 80.7%, OSWorld 2.0 binary completion by 3.0×, and Terminal-Bench 2.1 success from 69.7% to 77.2%. The gains carry over from Qwen 3.7-Plus to Claude Opus 4.7.

Table 1 · WeaveBench results (114 tasks).
Agent Harness PR ↑ Overall ↑ DSKDOCGAMWEBDAVOPSSPADES
Claude Opus 4.7Claude Code 41.20.532 55.647.123.553.323.150.033.340.0
Claude Opus 4.7OpenClaw 35.10.482 55.629.423.566.715.441.716.720.0
Claude Opus 4.7Hermes Agent 28.10.516 33.347.111.826.730.850.08.310.0
Claude Opus 4.7Codex CLI 13.20.378 16.711.811.86.77.725.016.710.0
GPT-5.5Codex CLI 35.10.499 38.929.423.553.315.450.058.310.0
GPT-5.5OpenClaw 33.30.466 38.935.335.321.423.138.533.340.0
GPT-5.5Hermes Agent 31.60.466 55.629.435.340.07.725.025.020.0
GPT-5.5Claude Code 14.90.299 33.311.811.80.015.416.725.00.0
GPT-5.4OpenClaw 22.80.465 55.635.35.90.023.123.18.320.0
GPT-5.3-codexOpenClaw 18.40.456 33.323.529.40.07.716.78.320.0
GPT-5.2-codexOpenClaw 6.10.321 5.611.80.00.015.416.70.00.0
GPT-5.1-codexOpenClaw 1.80.226 0.05.90.00.07.70.00.00.0
Gemini 3.1 proOpenClaw 1.80.223 0.00.00.00.00.08.38.30.0
Qwen3.5-397B-A17BOpenClaw 0.90.318 0.00.00.00.00.08.30.00.0
Qwen3-VL-8B-ThinkOpenClaw 0.90.092 0.00.00.00.08.30.00.00.0
GUI-Owl-1.5-32BOpenClaw 0.00.065 0.00.00.00.00.00.00.00.0
Qwen 3.7-PlusClaude Code 51.80.702 83.376.529.446.753.866.716.720.0
Qwen 3.7-Plus LongHorizon-Harness (ours) 80.70.835 88.9100.058.873.384.691.766.780.0
Change vs. the same backbone on bare Claude Code +28.9+0.133 +5.6+23.5+29.4+26.6+30.8+25.0+50.0+60.0

Gray rows are official results reported by WeaveBench (best thinking mode per backbone); PR denotes PassRate (%), Overall the mean per-task score. All eight domains improve and DOC reaches 100.0. Our runs execute the agent with root privileges inside the task VM, whereas the official baselines run under a regular user account, so the gray rows are reference points rather than strictly matched comparisons.

Terminal-Bench 2.1 leaderboard: LongHorizon-Harness with Codex and GPT-5.6 Luna reaches 83.1%, and with Claude Code and Qwen 3.7-Plus reaches 77.2%, up from the 69.7% baseline.
Terminal-Bench 2.1 official leaderboard LongHorizon-Harness retains Claude Code as its executor backend and improves success rate from 69.7% to 77.2%. Values marked with ∗ are externally reported metrics.
Table 2 · OSWorld 2.0 (108 desktop workflows).
Agent Harness / Mode Binary ↑ Partial ↑
Claude Opus 4.8Batched actions20.654.8
Claude Opus 4.7Batched actions18.248.9
GPT-5.5Batched actions13.049.5
Claude Opus 4.8Single action18.549.3
Claude Opus 4.7Single action13.949.1
Claude Sonnet 4.6Single action8.341.5
MiniMax M3Single action4.622.3
Kimi 2.6Single action4.622.1
Qwen 3.7-PlusSingle action2.821.5
Qwen 3.7-Plus LongHorizon-Harness 8.335.2

Gray rows denote official results reported by OSWorld 2.0 under batched- and single-action settings, while the black row denotes LongHorizon-Harness with Qwen 3.7-Plus in the hybrid setting. Binary is the percentage of tasks whose final benchmark score equals 1, and Partial is the mean benchmark score over all 108 tasks. Bold marks the best official result.

Table 3 · OSWorld 2.0 Opus 4.7 subset (34 tasks).
Agent Harness / Mode Binary ↑ Partial ↑
Claude Opus 4.7Single action20.655.8
Claude Opus 4.7 LongHorizon-Harness 35.366.9

Swapping only the harness lifts binary completion by +14.7 points and partial score by +11.1, so the gains are a property of the framework rather than of one backbone. The backbone still decides the quality of each round’s actions, while the harness decides how reliably verified outcomes survive between rounds. That is why the two compound instead of substituting for each other.

  • WeaveBench PassRate 51.880.7 +28.9
  • OSWorld 2.0 Binary completion 2.88.3 3.0×
  • Terminal-Bench 2.1 Success rate 69.777.2 +7.5
Cost–performance frontier on OSWorld 2.0 Binary completion (left) and partial score (right) versus average output tokens per task. Colored curves show the official results under different reasoning-effort settings, with marker size indicating the reasoning effort. The blue star denotes LongHorizon-Harness with Qwen 3.7-Plus, and the dashed arrow shows its improvement over the official single-action Qwen 3.7-Plus.
Two scatter panels of OSWorld 2.0 binary completion and partial score against output tokens per task. A blue star marks LongHorizon-Harness with Qwen 3.7-Plus, reached by a dashed arrow from the single-action baseline.
Cost & Attribution

Coordination is cheap; token cost tracks the backbone, not the architecture.

The manager accounts for only 2.8% (WeaveBench), 2.0% (OSWorld 2.0), and 8.1% (Terminal-Bench 2.1) of total tokens. Auditing is the larger investment at 19.4%, 24.8%, and 38.1%. And overall cost is not uniformly higher: on Terminal-Bench 2.1 the harness consumes 24% fewer tokens than the baseline while gaining 7.5 points.

Where the tokens go Average tokens per task consumed by the manager, executor, and auditor in LongHorizon-Harness, compared with the corresponding baseline. Segment labels report the fraction consumed by each role. All LH-Harness roles use Qwen 3.7-Plus. WeaveBench and Terminal-Bench 2.1 report total tokens, whereas OSWorld 2.0 reports output tokens because the official results provide only output-token statistics.
Stacked bars of tokens per task on WeaveBench, OSWorld 2.0 and Terminal-Bench 2.1, split into manager, executor and auditor shares against the baseline agent.
−33% Overhead is not intrinsic

On the 17 Games tasks the same framework inverts sign by backbone: Opus 4.7 spends 33% fewer tokens (16.5M → 11.1M) while scoring higher, whereas Qwen 3.7-Plus spends 3.2× more (10.7M → 34.3M). A stronger backbone satisfies a contract in fewer audit–replan rounds.

0.733vs0.680 Capability is a system property

On those same tasks Qwen 3.7-Plus under the harness reaches 0.733, above the 0.680 that Opus 4.7 reaches on bare Claude Code. A harness cannot add primitive capability, but it decides how much of it survives to the end of the task.

Where the gains come from LongHorizon-Harness (blue) is compared with the same-model baseline (gray) across WeaveBench domains (left), OSWorld 2.0 capability tags (middle), and Terminal-Bench 2.1 categories (right). The rightmost column of each panel reports the absolute performance change in points. Blue connectors indicate improvements, and red connectors indicate regressions. Parenthesized values report the number of OSWorld tasks or Terminal-Bench trajectories in each category.
Three dumbbell panels comparing baseline and LongHorizon-Harness across WeaveBench domains, OSWorld 2.0 capability tags and Terminal-Bench 2.1 categories, with the point change listed at the right of each panel.
Insights

Four recurring patterns in paired trajectories.

We compare paired trajectories in which the Claude Code baseline and LongHorizon-Harness execute the same task using the same Qwen 3.7-Plus model. These cases examine what persists between rounds under the MEA loop.

Recovering from a stalled interaction.

The baseline does notice the failed GUI interaction, but the observation stays buried in its growing execution history, so it retries the same interaction for 400+ steps. The harness writes the stall and the unresolved evidence gaps into the task state, so recovery resumes from the latest audited state rather than from the failed trajectory.

Wireshark’s “Decode As” dialog stops responding. The baseline degenerates into 400+ steps of repeated clicking; the auditor rewrites the same difficulty into concrete evidence gaps, and the next round targets only the unmet items.

WEB_task_16 · WebRTC simulcast layer audit · 0.590.92
WEB_task_16 storyboard: the baseline loops on an unresponsive Wireshark dialog while LongHorizon-Harness rewrites the failure into evidence gaps.
BibTeX

Cite this work.

If you use LongHorizon-Harness in your research, please cite the project.

@article{longhorizonharness2026,
  title={LongHorizon-Harness: Advancing Long-Horizon Agents for Real-World Tasks},
  author={Ziyu Ma and Hailang Huang and Shun Zou and Yong Wang and Shidong Yang and Yiming Hu and Fei Wei and XiangXiang Chu},
  journal={arXiv preprint arXiv:2608.01964},
  year   = {2026},
  url    = {https://arxiv.org/abs/2608.01964}
}
← Back to home
Benchmark
Harness
Domain