AgentUV LogoAGENT_UV
All posts
agentsharness

The harness makes the model stronger.

GPT-4 on SWE-bench Lite runs from 2.7% with retrieval to 28.3% with CodeR. GPT-4o runs from 18.3% in SWE-agent to 32% in Agentless. The weights stay put. The tools, the memory, and the check do the moving.

A model is a set of weights. A harness is the machinery around one call to those weights. It is the prompt that opens the session, the tools the model is allowed to use, the memory of earlier turns, the check that accepts or rejects a step, and the rule that decides whether the model chooses the next step or a fixed program does.

That is the same split this lab uses. The agent is the post-trained model. The harness is the tools, the memory, and the checks. A published score is almost always the pair, measured on a task that already has a way to say pass or fail. Change either half and the number moves. This note keeps the model fixed wherever a paper allows it, and writes down how far the other half moves the result.

The controlled measurements are mostly software tasks. A software task has a test, so a one-point change is a count of issues, not an impression. The same design questions show up wherever a check exists. They are harder to turn into a percent where the check is a person's judgment. The numbers below are the percents that have actually been published.

One checkpoint, three ways of touching the repo

The cleanest early measurement is SWE-agent, Yang, Jimenez, Wettig, Lieret, Yao, Narasimhan, and Press, at NeurIPS 2024. They froze GPT-4 Turbo, checkpoint gpt-4-1106-preview, and changed the interface the model used to work on a repository. The set is SWE-bench Lite: 300 real GitHub issues from popular Python projects. A run is resolved only when the patch applies and the project's tests pass. Each issue had a budget cap of $4. Past that cap, the edits already on disk were submitted as they stood.

Three harnesses, one model, on those 300 issues:

HarnessResolvedWhat the model was given
Retrieval, then one patch2.67% (8 of 300)Files retrieved for the issue, then a single patch. No loop.
Shell only11.00% (33 of 300)A Linux shell, turn by turn.
SWE-agent18.00% (54 of 300)A small set of view, search, and edit commands, plus a linter that refuses a broken edit.

The shell without its demonstration prompt resolved 7.33%. The paper's own summary is that the agent-computer interface was a 64% relative increase over the shell, both with GPT-4 Turbo. Average API cost, taken over the issues that were resolved, was $1.46 for the shell and $1.67 for SWE-agent. The extra resolves were a change in the interface.

On the full SWE-bench test set, 2,294 issues, retrieval with the same GPT-4 Turbo resolved 1.31%. SWE-agent resolved 12.47%, which is 286 issues. Claude 3 Opus in the same SWE-agent harness resolved 10.46% of the full set and 13.00% of Lite. Retrieval with Claude 3 Opus resolved 3.79% of the full set and 4.33% of Lite. The ordering is the same on both models. The interface that was built for GPT-4 Turbo still lifted Claude, and it lifted Claude by less.

OpenAI's note on SWE-bench Verified (13 August 2024, page updated 24 February 2025) states the spread for an earlier GPT-4 in one sentence. On SWE-bench Lite, GPT-4 runs from 2.7% with an early retrieval scaffold to 28.3% with CodeR. The Agentless results table records the same two rows: retrieval with GPT-4 at 8 of 300 (2.67%), CodeR with GPT-4 at 85 of 300 (28.33%). In that table CodeR's average run used $3.34 and 323,802 tokens. The resolve rate is about ten times higher. The model name on the two rows is the same.

What each piece of the interface was worth

SWE-agent then took the 18.0% apart. One design choice changed at a time. The model stayed GPT-4 Turbo. The set stayed the 300 Lite issues. The first chart is the harness around the model. The second is the shipped agent with one piece replaced. The last bar of each chart is the interface they kept.

GPT-4 Turbo on Lite, by harness

%

01020GPT-4 Turbo on Lite, by harness, RAG: 2.672.67RAGGPT-4 Turbo on Lite, by harness, No demo: 7.337.33No demoGPT-4 Turbo on Lite, by harness, No editor: 10.310.3No editorGPT-4 Turbo on Lite, by harness, Shell: 1111ShellGPT-4 Turbo on Lite, by harness, SWE-agent: 1818SWE-agent
Resolve rate on 300 issues. The model is GPT-4 Turbo (gpt-4-1106-preview). RAG is retrieval and one patch. No demo is the shell without its demonstration prompt. Shell is the Linux shell with the demonstration. No editor is SWE-agent forced to edit through the shell. SWE-agent is the shipped interface. From Yang, Jimenez, et al., NeurIPS 2024.
GPT-4 Turbo on Lite, by harness
LabelGPT-4 Turbo on Lite, by harness
RAG2.67 %
No demo7.33 %
No editor10.3 %
Shell11 %
SWE-agent18 %

The remaining bars are the shipped interface with one piece swapped. One-by-one search shows matches the way a text editor does. Whole file and 30 lines are the file window. No linter lets a broken edit stay. History keeps every older observation. No search removes the search commands. The demonstration prompt, removed on its own, scored 16.3%, between No search and the shipped agent.

Same agent, one piece changed

%

01020Same agent, one piece changed, One by one: 1212One by oneSame agent, one piece changed, Whole file: 12.712.7Whole fileSame agent, one piece changed, 30 lines: 14.314.330 linesSame agent, one piece changed, No linter: 1515No linterSame agent, one piece changed, History: 1515HistorySame agent, one piece changed, No search: 15.715.7No searchSame agent, one piece changed, SWE-agent: 1818SWE-agent
Still GPT-4 Turbo on the 300 Lite issues. Each bar except the last is the shipped SWE-agent with one piece replaced. SWE-agent, at 18%, is the unchanged interface. Removing the demonstration prompt, not shown here, scored 16.3%.
Same agent, one piece changed
LabelSame agent, one piece changed
One by one12 %
Whole file12.7 %
30 lines14.3 %
No linter15 %
History15 %
No search15.7 %
SWE-agent18 %

The editor is the largest single cut. SWE-agent edits by naming a line range and a replacement, then shows the updated window. Without that command, the model had to rewrite files through the shell, by redirection or by sed. The resolve rate fell from 18.0% to 10.3%, a drop of 7.7 points. That is most of the gap between the shell and the full agent.

Search that behaves like a human editor, one match at a time with next and previous, fell to 12.0%. That is worse than having no special search command at all, which landed at 15.7%. The paper describes the behavior. Given a long list of hits, the model walked every match, spent the budget, and never reached the edit. A tool the model uses badly lowers the score of a model that would have done better with a shorter result list. The search they kept returns at most 50 hits and, past that limit, tells the model to write a more specific query. That version is the 18.0% bar.

The file window has a peak in the middle. A window of 30 lines scored 14.3%. A window of the whole file scored 12.7%. A window of 100 lines, the one they kept, scored 18.0%. Too little context hides the function. Too much context crowds out the issue text and the plan. Every line the model sees is a line it has to carry.

The linter is a check, sitting on the edit command. An edit that introduces a syntax error is discarded, and the model is shown the failure and asked to edit again. Turning that guardrail off dropped the score from 18.0% to 15.0%. The model was repeating a broken edit. The harness stopped the repetition.

Memory has a number of the same size. SWE-agent keeps the last five observations in full and collapses each older observation to a single line. Keeping the full history dropped the score from 18.0% to 15.0%. The old file contents were still in the prompt after the file had changed, and the extra text shortened the number of turns that fit. Removing the demonstration from the prompt dropped the score from 18.0% to 16.3%. The demonstration is worth less than the editor, and it is still worth more than a point on a 300-issue set, which is five issues.

Read as counts, the shipped harness resolved 54 of 300. The shell resolved 33. Retrieval resolved 8. The no-editor variant resolved about 31. The no-linter variant resolved 45. These are the same weights. The difference is what the model was allowed to call, what it was shown afterward, and what the harness refused to keep.

A fixed pipeline against a free loop

By the summer of 2024 the open question had turned around. Xia, Deng, Dunn, and Zhang asked whether the model had to be the one choosing the next action. Agentless does not give it that choice. The harness runs three stages in an order the authors wrote down: localize, repair, validate. The model is called inside each stage. It ranks files, proposes edits, and writes tests. It does not decide to skip a stage or invent a tool.

The model is GPT-4o, checkpoint gpt-4o-2024-05-13. The set is the same 300 Lite issues. In their table, SWE-agent with GPT-4o resolved 55 issues, 18.33%, at an average run cost of $2.53 and 498,346 tokens. Agentless with GPT-4o resolved 96 issues, 32.00%, at an average run cost of $0.70 and 78,166 tokens. The fixed pipeline resolved 41 more issues and used about a sixth of the tokens. SWE-agent's own paper averages cost over resolved issues only, so the $1.67 from that paper and the $2.53 from this table are different averages. The token counts sit in one table, under one definition, and they are directly comparable.

OpenAI then used Agentless as the open scaffold for the GPT-4o number on SWE-bench Verified, the human-filtered set of 500 issues. GPT-4o resolved 33.2% of Verified. The same note says GPT-4o had resolved 16% of the original SWE-bench. OpenAI describes the Verified scaffold runs as one seed, at the closest documented settings, and warns that a single seed can disagree with a later leaderboard. The 33.2% is a real published number with that caveat attached.

The chart is the two GPT-4o rows from the Agentless paper, on Lite.

GPT-4o on SWE-bench Lite, two harnesses

%

0102030GPT-4o on SWE-bench Lite, two harnesses, SWE-agent: 18.318.3SWE-agentGPT-4o on SWE-bench Lite, two harnesses, Agentless: 3232Agentless
Both bars are gpt-4o-2024-05-13 on 300 issues. SWE-agent lets the model choose the next action. Agentless runs localization, repair, and patch selection in a fixed order. From Xia, Deng, Dunn, and Zhang, Agentless, 2024. SWE-agent resolved 55 issues. Agentless resolved 96.
GPT-4o on SWE-bench Lite, two harnesses
LabelGPT-4o on SWE-bench Lite, two harnesses
SWE-agent18.3 %
Agentless32 %

Inside Agentless, the check that picks the patch is a large part of the 32%. The model writes many candidate patches. Something has to choose one to submit. The authors measured three selection rules on the same candidates.

How the harness picks the patchResolvedAdded cost in their table
Majority vote77 (25.67%)$0.00
Vote, then prefer patches with fewer failures on existing tests81 (27.00%)$0.01
Then keep patches that also pass a generated reproduction test96 (32.00%)$0.25

The reproduction test is the step that adds the last 15 fixes, from 81 to 96. The model had already written those patches. A weaker selection rule left them on the cutting-room floor. The tests themselves are uneven, and the paper counts the unevenness. Out of 300 issues, the harness produced 213 tests that printed the expected failure on the original repository. Only 94 of those 213 also accepted the developer's own patch. A bad test can crown a bad patch. The harness limits the damage. A candidate still has to survive the project's existing tests. If every candidate fails the new test, selection falls back to the regression results.

Sampling has its own curve, still on GPT-4o. One greedy patch for each of four location sets fixed 80 issues. The setting they shipped, 40 samples, fixed 96, and further samples stopped helping because the final choice is a vote. If an oracle could look through every sample and submit the best one, 126 issues had a correct patch somewhere in the pile. That is 42%. The distance from 32% submitted to 42% present is 30 issues. It is a limit of the selector, sitting on top of whatever limit the model had.

Localization, the first stage, moves the number before any patch is written. The authors report the share of issues whose ground-truth edit is still inside the context they hand to the next stage.

Localization stepGround truth still in viewAverage cost of the step
Prompt the model with the repository tree78.67% of issues$0.02
Embeddings over the files67.67%$0.05
Embeddings after a call drops irrelevant folders70.33%$0.04
Tree prompt and embeddings together81.67%$0.06
Then show the whole of each chosen file53.67%$0.15
Then show a skeleton of class and function headers58.33%$0.02

The skeleton is shorter and more accurate. Showing the whole file kept the right element in 53.67% of issues and cost $0.15. Showing headers kept it in 58.33% and cost $0.02. The repair stage shows the same preference for several small contexts over one merged context. Repair from one greedily chosen set of locations, with 40 patch samples, resolved 88 issues (29.33%). Merging several location samples into one context resolved 85 (28.33%). Keeping the four location sets separate, and repairing each of them, resolved 96 (32.00%). More context, in one prompt, made the model worse at pointing at the right lines.

Agentless also marked problems in the benchmark itself, which any harness can exploit. On Lite, 4.3% of issues contain the exact ground-truth patch in the description, 10.0% are missing information a correct patch would need, and 5.0% propose a solution that is misleading relative to the patch the developers merged. A harness that copies from the issue will look stronger on that slice. SWE-bench Verified was built to take a large part of that noise out. OpenAI's annotators, on a random subset, flagged 38.3% of sampled SWE-bench items for an underspecified problem statement and 61.1% for tests that could reject a valid solution. The filter removed 68.3% of the original items. A harness comparison on Verified is the cleaner reading. The direction of the effect, a different scaffold and a different score for one model, is visible on Lite and on Verified both.

The loop, before anyone called it a harness

The pattern is older than repository agents. ReAct, Yao, Zhao, Yu, Du, Shafran, Narasimhan, and Cao, 2022, is a prompting harness on a frozen model. The model is PaLM-540B. The change is the shape of the prompt and the tools inside the loop: a thought, an action, or the two interleaved, with Wikipedia or a simulated household on the other side of the action.

On FEVER, a fact-checking set, accuracy for PaLM-540B was 56.3 with chain-of-thought, 58.9 with actions and no thoughts, 60.9 with thoughts and actions interleaved, and 64.6 when a chain-of-thought vote that lacked a majority was allowed to fall back to the search loop. Self-consistency alone, 21 sampled chains, reached 60.4. The fallback harness beat the 21-sample vote.

On HotpotQA, exact match was 28.7 for a direct answer, 29.4 for chain-of-thought, 33.4 for self-consistency, 25.7 for actions without thoughts, 27.4 for ReAct, 34.2 for self-consistency falling back to ReAct, and 35.1 for ReAct falling back to self-consistency. Acting without a thought was the weakest of the prompted methods. Thinking without a tool was a little stronger than ReAct on this set. The harness that could use internal knowledge and a search, and that switched when one of them was failing, was the strongest prompted result. A supervised system built for the benchmark still sat far above all of them, at 67.5 exact match on HotpotQA and 89.5 accuracy on FEVER. The harness moved PaLM. It did not turn PaLM into a specialist model.

They labeled failure modes by hand, 50 trajectories with a correct answer and 50 with a wrong answer, for ReAct and for chain-of-thought. Among the chain-of-thought answers they marked as successes, 14% were false positives resting on a made-up fact. Among the ReAct successes, 6% were. Hallucination was 56% of the chain-of-thought failures in that sample. For ReAct, a search that returned nothing useful was 23% of the errors. The tool grounds the model when the page contains the fact. The same tool stalls the model when the page does not, because the next thought is about a bad observation.

ALFWorld is the decision-making measurement, and it is the large one. The agent completes household tasks in text. A task can run past 50 steps. Evaluation is 134 unseen games. Prompts were built from the same human demonstrations. The action-only prompt is the ReAct prompt with the thoughts deleted, so the comparison is the thought, held against a fixed model.

Method on ALFWorldSuccess, best trialHow the trial was chosen
BUTLER, imitation learning37%Best of 8
Actions, no thoughts45%Best of 6
Thoughts that only restate the environment53%Best of 6
ReAct, sparse thoughts71%Best of 6

The average ReAct trial scored 57%. The worst ReAct trial scored 48%, which is still above the best action-only trial and the best BUTLER trial. BUTLER was trained on 100,000 expert trajectories for each task type. ReAct saw two demonstrations in the prompt. Across the six controlled prompts, the relative gain of adding thoughts ran from 33% to 90%, and the average relative gain was 62%. The thoughts that only restated the environment, an inner-monologue ablation, lost 18 points to ReAct on the best trial, 53% against 71%. The content of the thought matters. A thought that decomposes the goal and names the next object is worth more than a thought that echoes the last observation.

ALFWorld success, best reported trial

%

050ALFWorld success, best reported trial, BUTLER: 3737BUTLERALFWorld success, best reported trial, Act: 4545ActALFWorld success, best reported trial, ReAct-IM: 5353ReAct-IMALFWorld success, best reported trial, ReAct: 7171ReAct
PaLM-540B for the three prompting rows. BUTLER is an imitation agent trained on 100,000 expert trajectories per task type. Act is the ReAct prompt with the thoughts removed. ReAct-IM restates the environment. ReAct adds sparse thoughts for the plan and the next object. 134 unseen games. From Yao et al., ReAct, 2022.
ALFWorld success, best reported trial
LabelALFWorld success, best reported trial
BUTLER37 %
Act45 %
ReAct-IM53 %
ReAct71 %

WebShop is the noisy version of the same idea. The agent buys a product from 1.18 million listings, given 500 test instructions. One-shot ReAct scored 66.6, with a success rate of 40.0%, meaning the bought item met every constraint. Action-only scored 62.3 and 30.1%. Imitation learning on 1,012 human trajectories scored 59.9 and 29.1%. Imitation plus reinforcement learning on 10,587 instructions scored 62.4 and 28.7%. People scored 82.1 and 59.6%. The prompting harness beat a trained policy by about ten points of success rate. A person, shopping carefully, remained about twenty points ahead of ReAct.

Fine-tuning on the harness traces is a different experiment, because the weights move. It belongs in the note because the data is the harness. With 3,000 ReAct trajectories that had reached a correct HotpotQA answer, a fine-tuned PaLM-8B ReAct model beat every prompting method they tried on PaLM-62B, and a fine-tuned PaLM-62B ReAct model beat every prompting method they tried on PaLM-540B. Fine-tuning on direct answers or on chain-of-thought, from the same questions, did worse than fine-tuning on the search trajectories. The paper's reading is that a direct answer teaches the model a fact, and a search trajectory teaches it how to go and get a fact. Prompting a frozen 540B model and training an 8B model on the loop are two different interventions. Both of them are measurements of the loop.

A task that does not fit in one window

The 2022 and 2024 numbers are one question, or one issue, inside one session. A program that takes a day, or a scientific run that accumulates notes, does not fit in one context window. Anthropic's engineering note of 26 November 2025, Effective harnesses for long-running agents, is about that gap. They do not publish a before-and-after percent. They do publish the failure modes of Claude Opus 4.5 in the Claude Agent SDK, given a high-level prompt such as "build a clone of claude.ai," and the harness changes that addressed each failure.

Compaction, which summarizes the window so the loop can continue, left both failures in place. In the first, the model tried to build the application in one session, ran out of context in the middle of a feature, and handed the next session a half-written change with no note about what was done. In the second, a later session saw that some features existed and declared the project finished.

The harness they describe is a protocol for what every session must leave on disk. The first session uses a different prompt. It writes an init.sh, a progress file, an initial git commit, and a JSON list of features, each one starting as failing. In the claude.ai example that list held more than 200 features, of the form "a user can open a new chat, type a query, press enter, and see a response." Later sessions are told to change a feature's pass field and are told, in strong language, to leave the tests themselves alone. JSON was chosen over Markdown because the model was less likely to rewrite a JSON file. Each later session does one feature, commits with a message, and appends to the progress file. A session starts by printing the working directory, reading the progress file and the feature list, reading the last twenty commits, running the init script, and checking that the basic path still works before it writes new code. For the web app, that check was a browser tool, driving the page the way a person would. Anthropic reports that the browser check let the model find bugs it did not find from the code or from a unit test or a curl. They also report bugs the tool cannot see. A native browser alert is invisible to the Puppeteer setup they used, and features that depended on those alerts stayed buggier.

The four failure modes and the files that answer them are the whole result:

What the model didWhat the harness requires
Tries to one-shot the project, or declares it done earlyA feature list, written in the first session, read at the start of every later session. One feature per session.
Leaves a broken or undocumented treeA progress file and a git commit at the end of the session. The next session reads both, and reverts through git when the tree is bad.
Marks a feature passing without an end-to-end checkThe pass field flips after the feature has been exercised, including through the browser when the product is a web app.
Spends the start of the session discovering how to run the appAn init.sh, written once, run at the start of every session.

This is the same kind of object as the SWE-agent linter. The weights are unchanged. The score, here observed as a finished application rather than a resolve rate, depends on files the harness forces into existence and on a check the harness runs before new work starts. Anthropic notes that the initializer and the later coding session are the same system prompt, the same tools, and the same harness, with a different opening instruction. They also leave open whether a single coding agent is the right shape, or whether a testing agent and a cleanup agent would do better on their slices. They name scientific research as one of the long-running settings the same lessons are likely to touch. They do not claim to have measured that setting.

A later harness throws the custom tools away

The group that built SWE-agent later published mini-swe-agent. The agent class is about a hundred lines. The only action is bash. There is no custom editor, no search command, and no tool-calling API, so any model that can write a shell command can run. History is a straight list of messages. Each action is a fresh process, which makes the sandbox a substitution for subprocess.run. The SWE-bench site now has a bash-only view of the 500 Verified issues in which every model runs inside that one harness. A gap on that board is a model gap, because the harness has been locked.

The README, as I read it on 26 October 2026, reports a score above 74% on SWE-bench Verified. The sentence does not name the model. I am leaving the 74% attached to the project, which is what the page says, and I am leaving the checkpoint unnamed, because the page leaves it unnamed.

The design reversal is the part that belongs with the 2024 ablations. For GPT-4 Turbo, a custom editor was worth 7.7 points and a linter was worth 3.0, because that model was bad at sed and bad at noticing that it had broken the indentation. The later harness deletes both tools and bets that a stronger model can operate the shell the older model could not. A harness is fitted to a model. A resolve rate from 2024, inside SWE-agent, is a statement about that model inside that interface. It is a weak prediction about a 2026 model inside bash, and the bash number is a weak explanation of the 2024 model.

How to read a score after this

A resolve rate with no harness attached is an incomplete measurement. The tables are the reason to treat it that way.

For GPT-4 on SWE-bench Lite, the published scaffold range cited by OpenAI is 2.7% to 28.3%. For GPT-4 Turbo, retrieval, a shell, and SWE-agent are 2.67%, 11.0%, and 18.0%, and the pieces inside SWE-agent move the rate by 1.7 to 7.7 points each. For GPT-4o, SWE-agent and Agentless are 18.33% and 32.00%, and the patch-selection rule inside Agentless moves the rate from 25.67% to 32.00% on candidates the model had already written. For PaLM-540B, adding a thought to an action moved the best ALFWorld trial from 45% to 71%. None of those gaps came from a training run on the model being scored.

Cost moves as well, and it moves in both directions. In the Agentless table, the free-form agent used 498,346 tokens to reach 18.33%, and the fixed pipeline used 78,166 tokens to reach 32.00%. A longer loop with more tools can be the lower score. The editor, the linter, the skeleton, the reproduction test, and the feature list each earned their points by removing a specific failure, which the ablations name: a bad sed edit, a repeated syntax error, a prompt stuffed with whole files, a vote that buried a good patch, a new session that could not tell what the last session had finished.

Two limits sit next to the numbers. The scaffolds were not all run under one budget, one temperature, and one seed. OpenAI says so about its own Verified comparison. SWE-bench Lite still contains issues whose text includes the patch, issues whose text is misleading, and issues that cannot be solved from the description. A harness that reads the issue closely will pick up some of those points, and a comparison on Verified is the fairer one. The second limit is the field. These percents exist because a test, a browser check, or a game score says pass or fail without a person in the loop. A scientific question often ends in a judgment. Where a check does exist, a proof assistant, a unit test, a held-out measurement, the harness questions in this note are the ones that have numbers: what the model is allowed to see, what it is allowed to change, what is written down for the next session, and what counts as done.

Sources

The resolve rates, costs, and token counts above are taken from these pages. Where a paper and a later table disagree, the sentence in the note says which one it is using.