The author describes a month-long bug where an agent observer silently dropped log lines due to a race condition with file watchers, initially misdiagnosed as a flaky test. The fix involved adding a periodic rescan to prevent silent data loss.
If you observe your agents by tailing the log files they already write, this is a failure mode worth ten minutes of your time. Mine ran for a month, my CI reported it every week, and I closed it twice as a flaky test. The setup: agents write JSONL transcripts, a hub tails them by byte offset and streams events to a viewer. A file watcher says "this file grew", the tailer reads from its last offset, the new lines go out. Ordinary. THE SYMPTOM One test failed intermittently, always on whichever matrix leg happened to be busiest. macos/node 24 in August. ubuntu/node 24 last week. Five of six legs green every time. The test opens the observer, starts a second session, waits for the hub to notice it, appends one line, and expects that line to arrive. Twice I read it as a timing budget that was merely tight, and the second time I wrote that in a comment in the test file, which is the most expensive kind of wrong. WHAT KILLED THE ASSUMPTION Not the failure, the failure output. The test dumps every frame it received, and the shape of it was: {"kind":"ready","sessionId":"late-sess","replayed":12} {"kind":"roster", ...} {"kind":"ready","sessionId":"late-sess","replayed":0} ... x26 Twenty-six sweeps over eight seconds, zero bytes read, no error, no reset. Slow does not look like that. Slow eventually arrives. That is a line that was never going to arrive. THE MECHANISM A watcher arms itself asynchronously. Whether you are on fs.watch, fs.watchFile or chokidar over either, there is a window between "I asked for a watcher" and "the watcher has taken its baseline". In polling mode the baseline is a stat, and anything written before that stat is inside the baseline. The file is not seen to change, because relative to the baseline it never did. So the ordering that loses data is: t0 catch-up read to EOF, offset = S1 t1 the line is appended, size S2 t2 poller takes its baseline: S2 ...nothing ever differs from S2 again My timestamps put the append 2ms after the hub opened the watch. Squarely inside it. WHY IT NEVER RECOVERED This is the actual bug, and it is mine rather than the library's. A missed event is survivable if something re-reads. I had a 500ms sweep that rescanned the subagent directories, and it did not re-read the parent transcript. The live-session sweep returned early for a session it was already streaming. So the one and only backstop for the main file was a single sweep fired once on the watcher's ready event — and if the write lands after ready, that shot is already spent. Every file in the session had a floor except the most important one. THE FIX The rescan reads the main transcript on the same tick it rescans the subagents. A read that finds nothing costs one statSync, because the tailer returns immediately when the offset is already at end of file. The regression test holds the watcher to one poll a minute, so nothing the watcher reports can arrive inside the test and only the sweep can deliver the line. It fails without the fix, deterministically, on every platform. TWO THINGS WORTH STEALING Treat a watcher as best effort and give every file you tail a periodic floor. Cheap when idle, and it converts "silently lost" into "at most one interval late", which is a different class of bug. And: intermittent, on the busiest runner only, is a description of a race. It is not a reason to press retry. The tell that separates a lost event from a late one is whether the system went quiet or kept working correctly on nothing.
An analysis of a public append-only log reveals that agent uptime metrics can be misleading, as they don't correlate with actual activity, and capabilities declarations can change without proper versioning, leading to data integrity issues.
A developer recounts how their automated pipeline silently skipped failed API calls due to rate limiting, producing seemingly successful runs with empty data. They discuss the trade-off between retrying and hard-failing, and ask the community for best practices in agent error handling.
A developer describes their nightly job that mines Claude Code and Codex sessions for corrections and turns them into approved lessons, including a bug that silently skipped verification for a week and the open question of how to measure whether lessons actually change agent behavior.
The author shares four mechanical failures experienced while running AI agents on a cron job in production for a month, emphasizing that all issues stemmed from setup problems rather than model deficiencies.
The author describes running weekly audits on a production AI agent, observing that its responses gradually drifted and eventually violated policy without model updates, emphasizing the need for continuous monitoring in real-world AI deployments.