Running AI Agents in Production: 27 Days of Failures

Dashboard of agent sessions illustrating running AI agents in production

A developer who has run a team of AI agents on everyday work for 27 days has published a frank list of what failed. Most of the failures were in the plumbing around the model, not the model itself. The lessons on running AI agents in production come from a setup that has logged 35 coordinator sessions, 105 worker sessions and 266 sub-agents since October 31.

How the setup works

A Claude Code coordinator session runs on the developer’s Mac from morning into evening, guided by a written manual. It turns requests into briefs, passes them to worker sessions or temporary sub-agents, reviews what returns and reports in a phone group chat. The jobs are mundane: email, app updates, server upkeep, research and fixing its own tools. Payments are the one hard limit, and the agents stop at checkout.

The model is rented. The developer built everything around it, and that is the part that breaks.

Context fills up, so state goes on disk

A busy day fills the context window by mid-afternoon. Hooks warn at 70% and 85%, and the coordinator writes a handoff file and starts a fresh session. The rule that makes this work is that state lives on disk. Every wake-up reads the disk, acts and writes back.

Two problems still showed up. A scheduled job opens the day’s coordinator at 8:45 if none is running, but such a session can’t enable remote control by itself, so it was invisible on the phone. And on November 11 the developer greeted yesterday’s session out of habit, which cost a day of desktop work. Now a small file records which session is on duty. A session that wakes up and sees another ID there halts and notifies the named one.

Idle waiting has a price, and so does a bad clock

The coordinator doesn’t poll. A small listener keeps a long-poll open to the chat server and quits once a message comes in, and that exit rouses the session. The first version also quit every 30 minutes with nothing to report. On November 14 that meant 24 pointless wake-ups, each re-reading a big context. It now exits every four hours.

One worker on November 13 was responsible for roughly 77% of the 1.3 billion or so context tokens that its model read all day. Its wait tool returned at once instead of blocking, so it spun in a loop at about 290,000 tokens per turn. Another worker, two days before that, had claimed it “waited 30 minutes with no reply” when it had waited one minute. The lesson: an agent’s feeling for elapsed time can’t replace a real clock.

Network trouble caused its own gaps. On day 7 the listener died with the connection and nothing re-armed it, leaving four hours of unseen messages. Catch-up on reconnect and on start shipped soon after. Even so, on day 13 a message landed seven seconds before the listener re-armed and sat for half an hour. The coordinator now reads once more right before re-arming.

Loud failures need a listener

The chat service the coordinator reports through is AndCo, built so people and their agents can share groups. On November 2 the developer found that another user’s agent had been deaf for 19 days. The client handled a 401 error and nothing else. Any other failure meant waiting 15 seconds and retrying silently, forever. Its owner had pinged it in a group for two days before anyone caught on.

The fix was to log non-401 failures to stderr and to exit with code 2 after ten minutes of continuous failure. On November 17 that exit fired in the developer’s own setup when a network relay stopped working. The exit should have woken the coordinator to re-arm the listener, but nothing came back until 21:55, and the midday and evening runs were missed. The only watcher of the listener was the session that relied on it. Now exit code 2 triggers an immediate re-arm, and each scheduled job runs on a timer of its own.

Desktop apps and guardrails when running AI agents in production

Some work needs GUI apps with no API. Computer-use permission is granted per session, and workers opened by scheduled jobs had nobody to click Allow, so the developer set up three operator sessions that live for days, one per app, approved once and now handed tasks. On November 18 a check for the signed-in account found the personal one active, and the operator sent nothing.

A taint-tracking guard built on November 1 limited a session’s tool calls once it had read outside content. It needed six patches in five days. A URL inside a written file counted as a fetch, and a session started by a tainted one inherited the taint. The developer retired it on November 6, concluding that taint belongs to a piece of data, not to a whole session.

Claude Code’s auto mode counts an instruction only if the developer typed it in that session. That blocked ordinary sends early on, so the fix was allow rules in a settings file, changed by seven scripts run in the developer’s own terminal. A key broker also refused the developer’s own attempt to shorten the listener timeout from 30 to 15 minutes, because the signed grant said 30. Raising it to four hours on November 15 required a fresh grant and a fingerprint scan.

What the developer would tell a newcomer

For anyone running AI agents in production, the advice comes down to five points.

  • Keep state on disk, and have each wake-up read and write it.
  • Give every wait its own clock.
  • Decide who hears a failure before making it loud.
  • Write permissions as a file, not as prompts to click through.
  • Treat an agent’s report as a claim until you check the clock, the screen and the account.

The developer has not built the replacement for session-level taint tracking, so that gap is still open.

Source: Ethan

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.