Organizations: Tsinghua University · Renlab AI · Nanyang Technological University · Renmin University of China · Massachusetts Institute of Technology · Singapore-MIT Alliance for Research and Technology · Peking University · Southeast University
Repairing failures in tool-using agents can require coordinated changes to how the harness interprets tool receipts, assembles context, and checks actions. We introduce HookEvo, a framework that uses an existing agent runtime's lifecycle hooks to evolve task-specific harnesses. We instantiate HookEvo on DeepSeek Harness. In each round, a separate improver diagnoses failures from execution traces and proposes a candidate. HookEvo evaluates the candidate against the current harness on matched tasks and carries the retained version into the next round. A single candidate can jointly edit executable plugin handlers and the state they share within a task, allowing a tool receipt to inform context and control a later action. Using a frozen Qwen3-4B executor, the selected harnesses lead the reported Qwen3-4B comparisons, achieving 95.41% on ALFWorld, 70.56% on DBBench, 48.17% on WebShop, and 41.67% on OSBench. Across three improvers and three edit scopes, from skill text to single-component and coordinated executable edits, GPT-6.1 Sol shows the largest average gain from the broadest scope. Our code is available at https://huangshengzebluesky.github.io/hookevo/.
Figures & tables
Figure 1: Edit scope and improver performance. (a) One proposal can revise skill text (A), one independent component (B), or a composition of mechanisms that share episode state (C). (b) In the illustrated C candidate, one mechanism processes a tool receipt and another uses the resulting state to guide context assembly and check the next action. (c) Mean test success across four benchmarks and the observed gain from A to C in percentage points (Table 3 ).
Figure 2: Mapping prior candidate artifacts to a shared HookEvo representation. The left column groups the artifacts optimized by prior methods. The middle column gives possible implementations using DeepSeek Harness (DSH) plugins and services. The right column shows a candidate whose text, plugin code, state logic, and wiring can be inspected and edited together by the improver and loaded into the existing DSH runtime.
Figure 3: One round of HookEvo. Parent runs supply traces for the improver and baseline outcomes for paired evaluation. A scoped patch yields one candidate. Under scope C, its handlers can share state across execution steps within a task. The controller compares the two harnesses on matched runs, carries the retained source into the next round, and returns measured changes and its decision to the improver.
Figure 4: Sol-C search histories (Table 2 ): 40 rounds for ALFWorld, DBBench, and OSBench; 80 across two WebShop stages. Gray shows candidate scores, dashed blue their trend, and green retained scores (six-round means for DBBench and WebShop). Stars mark peak test means with sample SD over three executions.
Method
ALFWorld
DBBench
WebShop
OSBench
Results reported in prior work
Life-Harness ( Xu et al. 2026 )
88.07
65.00
45.50
39.60
Bare ( Xu et al. 2026 )
16.51
44.00
29.50
21.50
ALIGN ( Liu et al. 2026 )
28.36
—
18.00
—
AgentSquare ( Shang et al. 2025 )
29.36
—
18.50
—
Meta-Harness (Life rerun) ( Lee et al. 2026 )
35.80
50.30
42.50
25.70
Table 2: Reported and local benchmark results for Qwen3-4B-family executors.
Improver
Scope
ALFWorld
DBBench
WebShop
OSBench
Mean
GPT-6 Luna
A
23.85
53.00
32.33
34.26
35.86
B
14.07
54.56
31.33
37.50
34.36
C
48.62
57.00
30.67
36.11
43.10
GPT-6.1 Terra
A
26.91
53.78
30.50
39.58
37.69
B
29.97
53.78
29.33
33.56
36.66
C
52.91
54.00
32.83
34.03
43.44
Table 3: Test success by improver and harness edit scope.
GPT-6 Luna
GPT-6.1 Terra
GPT-6.1 Sol
Benchmark
Δ
Mechanism
Δ
Mechanism
Δ
Mechanism
ALFWorld
+32.11
Training traces show receipt reminders and wrong-object checks.
+36.40
Training traces show pickup guidance and a target check in two-object tasks.
+78.90
Inventory and search history tell the action check when to require a pickup or stop a repeated search.
DBBench
+13.00
An empty read can hold up submission until the agent checks the result.
+10.00
A SQL skill tells the agent how to quote identifiers.
+26.56
A log of successful writes guards two decisions: whether to repeat a write and whether to submit.
WebShop
+1.17
A checklist prompts the agent to inspect options and price.
+3.33
A search skill preserves model numbers and sizes across queries.
+18.67
Search and option plugins share product state. Checkout can be blocked until a required option is selected.
OSBench
+14.61
A counting skill distinguishes files from matching lines.
+12.53
A command check flags misleading pipelines. Receipt annotations explain the output.
+20.17
A skill specifies which files to inspect and which quantity to count.
Table 4: Mechanisms evolved by each improver under scope C. Δ is the change in test success (percentage points) relative to bare Qwen3-4B on the same benchmark (Appendix D).
Scope A → B
Scope B → C
Benchmark
Δ
Mechanism
Δ
Mechanism
ALFWorld
+6.12
Target-tracking instructions gain inventory updates from tool receipts.
+62.08
The action check goes beyond call format: it reads inventory and can block departure before pickup.
DBBench
+0.67
SQL naming guidance is supplemented by repair suggestions after a query fails.
+17.00
A log of successful writes lets the harness block duplicate writes or early submission.
WebShop
+3.33
The option checklist gains page feedback that highlights matching choices.
+10.50
Search and checkout share option state, so a missing selection can block purchase.
OSBench
+1.85
A receipt annotation tells the agent whether its command counted files or lines.
+2.08
A written rule for file selection and aggregation replaces the output annotation.
Table 5: Mechanisms evolved by Sol as edit scope expands. Δ is the change in test success from the narrower to the wider scope, in percentage points.
Executor
Method / harness
ALFWorld
DBBench
WebShop
OSBench
Source
Qwen3-4B: evolved artifacts and additional baselines
Qwen3-4B
Ours: Sol high
95.41 ± 0.00
70.56 ± 0.38
48.17 ± 0.29
41.67 ± 1.84
Local
Qwen3-4B
ALIGN (released) ( Liu et al. 2026 )
3.36 ± 1.06
–
31.00 ± 0.50
–
Local
Qwen3-4B
ReAct ( Yao et al. 2023 )
10.70 ± 1.06
–
–
–
Local
Qwen3-4B
ReflAct ( Kim et al. 2025 )
18.35 ± 1.83
–
–
–
Local
Qwen3-4B
AutoManual ( Chen et al. 2024 )
76.15 ± 1.59
–
–
–
Local
Table 7: Comparison of evolved Qwen3-4B harnesses with additional methods and larger executors. Scores are test success (%); local measurements report mean and sample SD. Sources identify the numerical evaluations.
Figure 5: ALFWorld harness. The action-hint plugin parses accepted tool receipts and records episode state. Context assembly and the pre-execution guard use that state. The task-guide plugin supplies the household procedure.
Figure 6: DBBench harness. Query contracts constrain SQL construction. The write-workflow, result-bridge, sql-recovery, and budget-conductor plugins maintain local records. The result bridge parses SQL receipts into final-answer arguments.
Figure 7: WebShop harness. The search-evidence and option-ledger plugins use the same resume policy and share an agent-keyed WeakMap. Receipt observations update product and option evidence used in later search and purchase checks.
Figure 8: OSBench harness. The retained skill in config.skill is added at prompt assembly. The executable composition is empty. The frozen executor uses the native shell tools and submits through the native answer action.