An AI Bot That Watches Our Slack Channel and Diagnoses Its Own Errors A developer built a Slack-based watcher bot that reads the error posts of other bots, opens the relevant source file and log, writes a plain-language diagnosis naming the failing file and function, and proposes a patch as a diff — but is deliberately denied write access and cannot apply or deploy any change. The design was tested one September morning when three bots went silent at once: a support platform API hostname failing to resolve with "Name or service not known" flooded the log with identical stack traces, and underneath that flood a launchd-run bot died silently because launchd's minimal PATH could not find the bare `claude` CLI name. The fixes were resolver backoff of 30 s, then 60, then 120, one log line per failure instead of a trace, a public resolver fallback, and resolving the CLI's absolute path once at startup. Slack bots & approvals https://botsinproduction.com/blog slack-bots An AI Bot That Watches Our Slack Channel and Diagnoses Its Own Errors A bot that reads our bots' failures and proposes patches it may not apply, plus the morning a DNS flood and a launchd PATH trap silenced three bots. When you run bots without a developer, the question isn’t “will they fail?” yes, with enthusiasm but “who notices?” For months the honest answer was “me, eventually, by scrolling”. So I built a bot whose entire job is to read the other bots’ failures and tell me what they mean. A bot for the bots. It’s bots all the way down. What it does 1. Reads the Slack channel where every bot posts its errors. 2. For each new error, opens the relevant source file and the log around that timestamp. 3. Writes a diagnosis in plain language: what failed, the likely cause, which file and function. 4. Proposes a patch as a diff. 5. Posts all of that back to the channel. And stops. Step five is the entire design. The watcher cannot apply a patch. It has no write access to the running code and no path to deploy anything. A human reads the proposal, decides, makes the change. People ask why I don’t let it “just fix things”. Because a bot that edits the code other bots run on, unattended, at 2am, is a bot that will eventually break all seventeen of them simultaneously, with a confident commit message and a cheerful emoji. I’ve met that bot in my dreams. It does not get write access. The morning three bots went quiet One morning in September the claims logger stopped posting. The usage-amount bot stopped answering. The watcher posted one diagnosis and then also went quiet, which felt personal. Three bots, one process, zero information. Two unrelated things had broken, and from Slack they looked like one thing. The order you diagnose them in turned out to be the whole lesson. Failure 1: the DNS flood The watcher’s one diagnosis was the useful one. The log was enormous, and 90% of its lines were the same error: the support platform’s API hostname failing to resolve. Not a 500. Not a timeout. Name or service not known , every few seconds, each with a full Python stack trace, each identical to the last. The machine’s DNS resolver was failing intermittently. Every poll hit it, every failure logged twenty lines, and the retry interval was short. Real errors from the other bots were in there somewhere, buried under an avalanche of the same sentence. The watcher proposed backing off and logging one line instead of a trace. It was right, and we went one step further: - On resolver failure, back off 30 s, then 60, then 120 instead of retrying immediately like an over-eager puppy. - Log one line per failure, not a trace. The trace is identical every time and tells you nothing after the first. - A public resolver as fallback in the machine’s network settings. Failure 2: the PATH trap, hiding under the flood Quieting the log was debugging in its own right. With one line per failure, errors that had been buried for days showed up at once. One of them: a bot that worked perfectly from a terminal had died silently as a launchd service. It logged “starting” and then did nothing. No error. Just a bot sitting in the dark. launchd does not run your shell profile. The PATH it hands a service is minimal to the point of rudeness. The bot called the Claude CLI by its bare name, claude , which the shell could find and launchd could not. The subprocess failed with “command not found”, and the bot’s own error handling swallowed it whole without chewing. Two fixes, both permanent. Full paths everywhere : the code resolves the CLI’s absolute path once at startup and never calls the bare name again. python def claude cli : never call the bare name 'claude' — launchd has no PATH for p in os.environ.get 'CLAUDE CLI' , '/opt/homebrew/bin/claude', os.path.expanduser '~/.local/bin/claude' , shutil.which 'claude' : if p and os.path.exists p : return p raise RuntimeError 'claude CLI not found; set CLAUDE CLI' And an explicit PATH in the plist , so anything else the bot shells out to behaves the same under launchd as in a terminal: