TL;DR
I wired my autonomous coding agent into CI so it watches failing builds and opens fix PRs on its own. It's saved me a genuine chunk of "why is main red again" time, but it also taught me a hard lesson about what happens when you let an agent optimize for "tests pass" instead of "the code is correct." Here's the setup, the guardrails I had to add after it went wrong, and what I'd do differently.
The Problem
I run a fully autonomous coding agent that works on my projects continuously — picking up tasks, writing code, opening PRs. For months it did all of that fine, but there was one gap: when CI went red, nothing happened. The agent kept working on whatever was next in its queue, and the broken build just... sat there. Sometimes for a day, sometimes longer, until I noticed it myself.
That's a dumb failure mode for a system that's supposed to be autonomous. A red build is one of the clearest, most unambiguous signals a codebase can give you — "something is wrong, here's the exact diff that caused it, here's the exact error message." If an agent can write code, it should absolutely be able to read a stack trace and take a first pass at fixing it.






