AutoMerge is generally available

  • 8 min read

How Agent0 hunts the bugs for us

Lukas Toma
Lukas Toma(Dash0)
Nestor Sokil
Nestor Sokil
How Agent0 hunts the bugs for us: a bug Agent0 found in production telemetry, resolved alerts left open when Opsgenie rate-limits an update, next to 82 pull requests opened, 79 merged and 41 bugs a user could hit.

When an issue in Dash0 resolved, we sent Opsgenie three text updates, for the message, the details and the description, and then closed the alert. Sometimes Opsgenie rate-limited one of those updates and answered with a 429. That ended the chain. Nothing sent the update again, the close never ran, and the alert stayed open in the customer's Opsgenie for a problem that was already over.

That happened 842 times in one week, and no check rule fired, because the service itself stayed healthy. The bug showed up only as error spans and log lines from the Opsgenie integration.

An Agent0 automation found it in that telemetry, traced it to the code, and opened a pull request that closes the alert before sending the updates. In the almost three days after the fix went out, no alert was left open.

Dash0 Trace Explorer filtered to calls from our notifications service to Opsgenie that got a 429, 27 October to 16 November 2026. Errors peak at about 900 in one burst on 3 November and stay low after. The span list shows PUT and POST calls on 15 November that still got a 429.
Calls from our notifications service that Opsgenie rate-limited, 27 October to 16 November. Most came in one burst on 3 November. Opsgenie still sends a 429 now and then, as on 15 November, but since the fix the alert is closed first.

The team that builds alerting and notifications in Dash0 runs this automation three times a day on their own production telemetry. In six weeks it opened 82 pull requests.

Bug hunt · 5 October to 16 November 2026Six weeks of fixes from production telemetry
Pull requests opened
82
Merged
79
Fixed a bug a user could hit
41
Median time to merge
0.8 h

How it hunts

Nestor, an engineer on the team, wrote the automation. Every run starts from telemetry. Agent0 picks the service it reviewed least recently and looks at the last 7 days: error patterns, panics, failed Kafka operations and the slowest operations. Then it reads the code those symptoms point to.

Before it changes anything, it has to answer three questions:

  • Can a user hit this today? It needs a named caller and an input that reaches the bug, and it checks our feature flag configuration so a code path that is switched off in production doesn't count.
  • Is it a quick win? One package, a test that fails before the fix and passes after it, no change to a public API, no migration, at most about three callers, and no commit from a person on those lines in the last 3 days.
  • Is someone already on it? If an open pull request or Linear issue covers it, the run skips it.

When a candidate passes, it fixes every place in the package with the same gap in one pull request, and adds a test for each. Once CI is green it asks the team for a review, and a person always merges. A run that opens no pull request posts one line to Slack and files its best leads as Linear issues, each saying why it needs a person.

Runs build on each other through Agent0's memory. The automation keeps four lists: which services and packages each run covered, bugs it confirmed but didn't fix yet, bugs too big for a quick fix, and why reviewers closed or changed its pull requests. Every run reads them first and updates them at the end. So a run doesn't read code that the last one just covered, doesn't repeat a fix, and avoids the kind of change a reviewer rejected before. When a run times out, the next one picks up where it stopped.

What it found

About half of the pull requests fixed a bug that a customer could run into. The rest made the code sturdier or more consistent, which is useful but less urgent. The automation sorts its own pull requests into these groups, and it's a little generous. When we had three review agents check its first 58, 7 of the ones it called bugs turned out to be hardening.

82 pull requests by kind
41bugs a user could hit
  • 41Real bugsReachable today, with a wrong result a user could see.
  • 24HardeningHardening with no known trigger.
  • 13InconsistenciesAnother code path already did it right.
  • 3Test only
  • 1Closed, not a bug
From the automation's pull requests, 5 October to 16 November 2026. The 24 newest carry the automation's own label and weren't re-checked.

Some of the bugs it fixed:

  • Alerting messages lost during restarts. When part of our message queue restarted, two of our alerting services dropped messages instead of sending them again. One of them lost 326 in a single day.
  • Gaps in charts. When a recording rule produced more than 10 MB of results, more than our message queue takes in one message, the results were never saved, and the chart had a gap. That happened about 760 times a day in one region.
  • Alert emails that never arrived. When Amazon SES asked us to slow down, we dropped the email. Every other integration tries again.
  • A usage warning with the wrong number. Customers who had used 90% of their budget got an email that said 75%.
  • Opsgenie alerts that closed too early. Every update to a synthetic check's alert closed it in Opsgenie, even while the check was still failing.
  • Charts missing from Slack notifications. Some charts used up our Slack file upload budget and then failed to send. That happened 3,183 times in the week before the fix, and not once after.

The automation still runs three times every working day, and it keeps finding bugs like these as new code ships.

What it saves, and what it costs

We don't have a number for hours saved, and we don't think it's the right kind of number. Once someone knows about a bug like the Opsgenie one, fixing it with a coding agent is quick. The slow part is knowing about it, and before the automation nobody was looking. Our check rules and SLOs cover what matters most. The smaller bugs below them stay there unless someone happens to look.

Now the only step that needs a person is a short review. Engineers on the team spend their time on features and bigger problems, and the automation clears the small ones underneath, two or three fixes every working day. It also keeps rereading code that was merged weeks ago, which nobody does by hand, so small drifts get fixed before they pile up.

For what it does, it's cheap. A pull request costs between about 120 and 165 Agent0 credits, depending on how long each run searches, and for that the team gets a tested fix for a bug nobody had found, ready to review. The team still tunes the search length against results. A 15-minute search made runs about 30% cheaper, but it found fewer real bugs, 3 instead of 8 that week, so on 17 November they went back to 30 minutes.

Set it up yourself

Our automation runs three times a day on one team's services and opens pull requests. The template we made from it runs once a week and only opens Linear issues. Every Monday at 08:00 UTC, it:

  1. Groups the week's error spans and error logs into patterns, and compares them with the week before.
  2. Keeps the patterns that are new or at least twice as frequent, and skips errors from requests your service was right to reject, such as bad input or a missing token.
  3. Drops every pattern that already has an open Linear issue.
  4. Looks into the rest: how often each one happens, example traces, and the likely code location in your GitHub repositories.
  5. Opens one Linear issue per pattern, at most 5 a run. Each issue ends with a fingerprint line, so next week's run recognizes it and doesn't open it again.

It never changes an existing issue and never opens a pull request, so you still write the fix. If you later want it to open pull requests too, or to run more often, you can change that yourself at any time.

The template is a starting point. Agent0 can help you change it to fit your services, for example to watch only some of them or to open more issues a run.

What we learned

  • Start from telemetry. Reading code turns up code that looks odd. An error count from production shows the bug is real and how often it hits, so our automation cites that count in its pull requests.
  • Ask for evidence and allow "not established". An issue that says it couldn't find the code location is more useful than one that guesses. The template's prompt asks for a source for every fact.
  • Cap the output. Ours allows six open pull requests at a time. In the second week that was more than we could review, and runs stopped until we caught up.
  • Check the fix in production. Merging the pull request doesn't tell you the errors stopped. Our audit automation compares the error count before and after each deploy. That's how we caught a fix that made a warning log a hundred times louder.