My AI agent was busy fixing a bug. The system declared it dead.

This week I built an AI agent that fixes software bugs, run from a team chat channel. It reads the error reports and the list of open tasks, picks one up, writes the fix and posts it in the chat for the team to review. A person approves every release. Always.
And then it got weird. In the middle of a long job, the system that runs the agent declared it dead. The agent was alive and working the whole time!
The fix was 4 lines. And finding it showed me where the real work in AI agents is.
The chat is only a receipt
The chat part took one afternoon. Where did the rest of the week go? Into everything that made the agent usable. And none of it was prompting.
When you type in a chat, you expect an answer in seconds. But a bug fix takes anywhere from 10 minutes to two hours. Build that as a normal question and answer, and it gets cut off after a few minutes of waiting. The user sees nothing. And you have no idea how far it got.
So the chat message is not the job. It is a receipt that points at the job. The job itself runs in a workflow engine, where a step that fails tries again.
Long waiting limits, on purpose. A job gets two hours to start and three to finish before the engine gives up on it. That feels wrong. Until you watch a real run take that long.
A cheap sorter in front. A small, fast AI sorts each request before anything expensive runs. It saves money, and when a request goes to the wrong place, I can see exactly which step chose wrong.
One job at a time, in total, for anything that changes the code. Two jobs editing the same files at once make a change that neither of them meant. And the worst part: the result looks deliberate.
Alive, but declared dead
During long AI sessions, the workflow engine kept marking the agent as dead. Again and again. The job was running. The AI was working.
Why would a working agent look dead? The agent read the AI's answer word by word, without a single break. While it was busy reading, it could not answer the engine's "are you alive?" check.
The fix was 4 lines. Take a short break every few messages, so the agent can answer. Done!
This is not one bug. It is a whole family of bugs. You put a long AI session inside a program, and the program can no longer say it is alive. Everything around it concludes it died.
The rule: the prompt is the easy part
Here is the rule. The hard part of an AI agent is not the prompt. It is the boring plumbing that any long job needs: jobs that survive a restart, honest timeouts, no double work, a way to see what a run did, and a limit on how many things touch the same code at once.
Get those right, and an average prompt still makes a useful agent. Get them wrong, and no prompt can save you.
What it taught me
When people talk about AI agents, they talk about the model: which one is smartest, which prompt works best. I did too, before this week.
But the moment that stayed with me was a working agent, doing exactly what I asked, declared dead by the system I built around it. So what was broken? Not the AI. My plumbing was not listening.
That is most of the job now. The model is the engine of the car, and it keeps getting better without me. What I build is everything around it: the brakes, the dashboard, the way it tells you it is still running. Nobody claps for that part. But that part decides if the thing can be trusted with real work on a Monday morning. And I love building it.
So when I look at an AI demo now, I do not ask how smart it is. I ask what happens when it takes two hours.
Things I did not expect
I also built a patrol: a job that looks at new errors every few hours and opens a task for anything that looks real. Why did it need a leash within a day? Two runs that overlap both find the same error and happily file it twice. So the patrol got the same limit: one run at a time.
Now the funniest part. The least clever thing I built was the one people read! Every morning a short digest goes out: what was fixed, what is waiting, what broke overnight. No clever AI, just a list. Of everything I built that month, it is the one the team actually opens. It keeps me humble about what "useful" means.
The agent never died. It was just too busy to say so.
I post one of these every week. Follow along on LinkedIn or YouTube, or by RSS. Want this on your team? Work with me.
The 527 rules I give my AI agents, free
Every one comes from a real mistake. The best 100 are open on /rules, or download them as AGENTS.md, no email. All 527 come by email, as one file you can drop straight into your repo as AGENTS.md or CLAUDE.md, so your agents follow them from the next session. Plus the occasional email when I learn a new one.
One click to unsubscribe.