The File Was Third
The right file sat third on the candidate list. Then my bug-investigation agent ran one more search pass and pushed it down to fifteenth.
I hit that regression while building Bug Basher, a weekend project designed to test how far an autonomous agent could get on real engineering bug reports without a human steering every search query. Giving the investigator an extra tracing pass sounded like an obvious upgrade. Instead, the extra pass flooded the candidate pool with high-scoring neighbors and knocked every ground-truth fix file out of the top ten. Even worse, final-list recall could not tell me whether an earlier step had already read the right code and dropped it before planning. Both the agent's retrieval loop and my harness needed surgery.
My starting setup was straightforward: pull historical bug tickets engineers had already closed, hand the agent only the bug report plus repository search tools, and compare its proposed fix against the pull request that actually shipped. Testing cold one-shot runs on messy historical tickets taught me far more than curating a demo around bugs I already knew a model could solve.
Plausible diagnoses in the wrong service
Early runs failed in a subtle, instructive way. One investigation described the exact failure mechanism in crisp prose and then proposed patching the wrong microservice. Another located the right module and recommended moving a state check in the exact opposite direction of the shipped fix.
Both write-ups read like confident senior-engineer notes. Had I graded the prototype by asking whether its diagnosis sounded helpful, both runs would have passed.
Iterating on prompts and code-navigation tools exposed recurring blind spots: upstream callers, sibling configuration files, and write paths where bad state entered long before a read path crashed. Once I let the agent choose multi-step searches dynamically, black-box end-to-end scoring stopped telling me why runs regressed. I had to instrument intermediate checkpoints: did search ever touch the target file, did reranking keep it near the top, and did the model actually inspect the file contents before drafting its patch plan?
Search depth versus ranking dilution
Intermediate telemetry caught the drop from third place to fifteenth. Across replay batches, late search stages burned most of the wall-clock budget without uncovering additional files touched in the ground-truth PRs. One broader trace pass occasionally surfaced a missing helper file while burying primary targets we already held in step one. Searching longer was not free, so each stage had to justify what it added against what it displaced.
Fixing that handoff meant changing how context traveled from search into fix planning. I pinned a floor of high-signal files discovered early so aggressive reranking could not evict them later, and pulled surrounding caller context into view whenever the planner proposed editing a function. Carrying wider context risks distracting the planner, which became another explicit trade-off to track on the next replay batch.
Auditing the pull-request answer key
Building an honest historical benchmark turned out to be harder than building the investigator. Withholding the fixing PR from the prompt was obvious, yet running search against HEAD leaked the fix directly through current repository files. Every file read and planning workspace had to be pinned to the exact pre-fix commit SHA, and post-fix developer comments on the ticket had to be stripped so they did not hand away the diagnosis.
Even a linked pull request is a noisy ground truth. In one eight-ticket replay batch, six comparisons fell apart under manual inspection: several tickets closed without code changes, one PR added diagnostic logging rather than a fix, and another PR belonged to an unrelated issue linked by mistake. Eight completed agent runs yielded two valid evaluations.
From that batch onward, I curated replay suites exclusively from resolved tickets with audited code fixes and added automated pre-checks to filter out logging-only or mismatched PRs. Run-to-run model variance still moved composite scores up on file recall while flipping a diagnosis on a neighboring ticket, reminding me how misleading a single aggregate percentage is on small evaluation sets.
Capable bug-triage agents have real leverage on the long tail of backlog defects where half the cost is reconstructing unfamiliar context. Getting there takes evaluation harnesses strict enough to catch when extra work makes the answer worse. On your own agent prototypes, which intermediate metric caught a regression that end-to-end pass rates hid?
Continue in Engineering Org & Leadership
The Next Engineer Has to Learn Somewhere
Last week I wrote why a token-consumption chart is an expense report rather than proof of engineering productivity. Funding open-ended exploration makes…
The Technical Job Changes
I want the engineers and leaders in my organization to make technical calls different from mine, and I want enough depth to know when to step in. Holding…