We Doubled a Local Model's Bug-Fix Rate Without Touching the Weights
We Doubled a Local Model's Bug-Fix Rate Without Touching the Weights
A 27B open-weights model, one GPU, real GitHub issues from SWE-bench-Live.
3 of 12 → 7 of 12. No fine-tuning. No larger model. No additional compute budget. Every point came from changing what the harness required of the agent between its own tool calls.
We ran fifteen controlled arms, changing one axis at a time. The interesting part is not that the number moved — it is which changes moved it, because most of the obvious ones did nothing at all.
The lever that doubled it: make the agent verify
Agents edit files and move on. Watch enough trajectories and the pattern is unmistakable: the model applies a change, forms a belief that it worked, and goes looking for the next thing. Nothing in a normal tool loop ever contradicts that belief.
We counted it. Across twelve instances, one arm made 39 edits and ran the tests 6 times. A wrong edit and a right edit are indistinguishable to a process that never checks, so it moves on with equal confidence from both.
The fix is not a better prompt. It is a harness policy: after the first successful edit, the next thing the agent reads demands that it run the tests. Not advice in a system prompt it saw twenty turns ago — a message injected into the tool result it is about to consume, at the moment it matters.
That single change took the arm from 3/12 to 7/12, and dropped empty-patch instances to zero.
Three details mattered more than we expected:
- Fire once per instance. A message repeated on every edit becomes noise the model learns to skip. A rule that fires constantly carries no information.
- Never fire on a rejected edit. There is nothing to verify yet, and nudging there pushes the agent past a failure it must fix first.
- Never fire on a search. Only an applied change needs proving.
The second lever: ranked hypotheses, each with a falsifier
Debugging conversations collapse onto the first plausible story. That is not irrationality — it is efficient, right up until the loudest signal points at something innocent.
We gave the agent a structured-reasoning tool built for exactly this shape
(awprism, one of our open packages): it
turns a failure symptom into k ranked hypotheses, and each one carries the
single observation that would confirm or rule it out.
That last part is what makes it work. A falsifier is not commentary — it is a tool call the agent can actually make. It converts "guess, then edit" into "predict, check, then edit."
Worth +1 instance on its own, and it halved empty patches from 4 to 2.
The levers that did nothing
Negative results are the cheapest thing to publish and the most expensive to rediscover, so:
Raising the step budget: nothing. We more than doubled the tool-loop ceiling, 16 → 40. The score stayed at 3, and it was the same three instances. The agent was not running out of room. It was running out of signal.
Escalation to a bigger model, for a small model: nothing. We wired a fast 8B orchestrator to a 27B reasoning tier and tried four variants — offered, forced, early, late. It scored zero in every configuration. A model that cannot reliably apply a fix does not become able to by being told a better one.
Richer error messages: nothing measurable. We made the edit tool explain why a match failed — whitespace, non-uniqueness, the nearest region with line numbers. Genuinely better tooling. It did not move the score by itself.
The pattern across all three: they add capacity, not feedback. Only the changes that closed a loop moved the number.
The finding we did not expect: availability is not reach
This is the one we would most like other teams to check on their own systems.
We registered 55 tools. We measured which ones the agent actually reached across 803 tool calls:
| share of calls | |
|---|---|
| routed to a specialist | 3% |
| did the work itself | 59% |
A structured-reasoning tool was registered on all twelve instances of one arm, appeared correctly in the model's tool schema, and was reached on none of them. Same for the reasoning escalation until we forced it. Both were wired to a live backend the whole time.
That failure is invisible from every direction you would normally look. Registration succeeds. The schema is correct. The run completes. The score simply does not move, and nothing anywhere says "the capability you added was never used." A tool with zero reach is indistinguishable from a tool that was never installed — which is precisely why the metric has to exist.
And measuring reach immediately taught us something about our own setup. Five other tools also showed zero calls, and for those the explanation was not model behaviour at all: this eval ran the agent framework deliberately isolated, on a GPU box with the models and nothing else. Those five reach back into platform services that simply were not deployed there. Even a perfectly routed call would have found nothing.
Which is worth stating plainly, because it bounds every number in this post: we measured the harness with the platform removed. The 7/12 is a floor for the whole system, not a ceiling — and it means the platform's own contribution is still unmeasured. The reach metric is what made that distinction visible at all; without it, "the model didn't use the tool" and "the tool had no backend" produce the identical zero.
So we made reach a first-class metric rather than a thing we assumed. It is now one command over recorded trajectories, and it is the number we watch when we add a capability — because "we shipped the tool" and "the agent uses the tool" turn out to be entirely different claims.
What the remaining gap is actually made of
Seven of twelve. We then read the per-test results for the five that remained, and they are not one problem:
- One had already solved the bug. Every one of its 14 target tests passed. It was scored unresolved because it broke 4 of 3,553 neighbouring tests it had no reason to run. A correct fix, over-reached, scored zero.
- One was one test short, 2 of 3 target tests passing.
- Three were genuine reasoning failures — wrong fix, no collateral damage.
That split is the whole roadmap. The first is a harness gap and we closed it: once the target test goes green, the agent is asked to run the whole file, because a passing target test proves the bug is fixed and proves nothing about what else the change touched. The last three are not harness problems. No policy we can write reaches them; that is where model work begins.
Knowing which of your failures are which is worth more than any single fix. Before we had per-test outcomes, all five looked like "the model isn't good enough." One of them was the opposite: the model was good enough and the scoring caught something the agent was never asked to look at.
The methodology bit, briefly
Two choices did more for the trustworthiness of these numbers than anything else, and both are cheap:
Validate the denominator. Before measuring any agent, we ran the reference patches through the same pipeline. Only 12 of 24 instances passed — the rest fail for environment reasons that have nothing to do with any agent. So our denominator is 12, not 24. Scoring against 24 would have quietly halved every number we reported and made every comparison mush.
Judge a tool result by parsing it, not by matching a string. Tool failures
arrive as structured payloads. A success test that looks for an ERROR prefix
will read {"error": "..."} as a success — and then every downstream policy
that keys on failure silently never fires. A trajectory that cannot represent
failure will always look like a calm one.
Both are the same discipline: make sure your instruments can register the thing you are trying to measure, before you trust what they tell you.
What we would tell another team
- Close a loop before you add a capability. The verify loop beat every capability we added, combined. It is a policy, not a feature.
- Measure reach, not registration. Count how often each tool is actually called. The gap between "available" and "used" is where the wins hide.
- Read per-test results, not the score. "Fix is wrong" and "fix broke a neighbour" look identical in a pass/fail column and need opposite remedies.
- Publish your negative results. Step budget, escalation, better error messages — all reasonable, all measured, all flat. That is three experiments nobody else has to pay for.
The headline is that a local open-weights model on a single GPU solved more than half of a validated real-issue benchmark, and every point of the improvement came from engineering around the model rather than replacing it.
The quieter result is that most of our assumptions about which levers mattered were wrong, and the only reason we know that is that we changed one axis at a time and measured all fifteen.
Model and infrastructure details are specific to our stack and not the interesting part. The four practices above are portable to any agent harness, and the reach metric in particular takes an afternoon to add.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.