Xavier Fok
← All writing

· 6 min read

The errors I let fail loudly on purpose

Why some errors in an AI automation pipeline should crash hard instead of quietly retrying, and how I decide which failures are allowed to be loud.

The failure mode nobody talks about

Most guides about running AI in production focus on making things resilient. Add a retry. Add a fallback. Catch the exception, log a warning, keep going. That instinct is right most of the time. But I run a handful of automation pipelines that touch AI agents, local rendering, and content generation every day, and the failures that have actually cost me time were never the ones that crashed. They were the ones that kept running.

A pipeline that silently retries a failed API call three times and then moves on looks healthy in every dashboard. A cron job that logs “warning: empty response, skipping” instead of paging anyone looks fine until you notice, a week later, that nothing got processed. An agent with tool access that can’t complete a step and quietly substitutes a plausible-looking answer instead of stopping is the worst of all, because it doesn’t even leave a warning behind. It just gives you output that’s wrong in a way that reads as right.

So over time I’ve built a short, deliberate list of errors I refuse to let recover gracefully. They fail loudly, on purpose, even when a quieter path exists.

What “fail loudly” actually means here

Fail loudly doesn’t mean “throw a stack trace and hope someone reads the logs.” A stack trace buried in a log file at 3am is still a silent failure in practice, because nobody sees it until the damage is already done. What I mean is more specific: the failure has to interrupt something a human will actually notice, at the moment it happens, in a way that stops the bad output from going further downstream.

For me that usually means one of three things. The process exits non-zero and the thing that scheduled it (a cron entry, a task runner, a webhook) treats that as a real failure instead of swallowing it. A message goes somewhere I check daily, not a log file I check when something already looks wrong. Or the downstream step that would consume the bad output simply refuses to run without a valid input, so the error can’t propagate quietly into something that looks finished.

The common thread is that the error has to cost something immediately. If it doesn’t cost anything until three weeks later when I’m debugging a totally different problem, it’s not actually failing loudly, it’s just failing later.

Where I let things break on purpose

The clearest example is my rendering pipeline. When a local render job produces an output file, I don’t just check that the process exited cleanly. I check that the file exists, that it’s above a minimum size, and that its length is roughly what the source material implies. A render that finishes in two seconds and produces a file a fraction of the expected size is not a successful render, even though the process itself returned exit code zero. I’d rather the job fail hard and stop the queue than let a broken or truncated file get treated as done and quietly passed on to the next step, because the next step doesn’t know how to tell the difference between “finished” and “finished wrong.”

The same logic applies to anything an AI agent does with tool access. If an agent calls a tool and the tool call fails, or the response doesn’t match the shape the next step expects, I don’t want the agent trying to paper over that by guessing a reasonable-sounding substitute. I want the run to stop. An agent that can’t get a real answer and produces a plausible one instead is the single most dangerous failure mode in this kind of setup, because the output looks identical to a correct one until someone checks the source.

Content generation gets the same treatment. If a step in an article or script pipeline comes back empty, truncated, or clearly off-topic, I don’t want it silently skipped so the pipeline can move on to the next item in the queue. I want that item to stop and sit there, visibly incomplete, until I look at it.

The retry that quietly became a lie

Retries are the most common way a system starts lying to you without anyone deciding it should. A retry on a transient network error is fine. A retry that keeps trying and eventually succeeds is also fine, that’s what retries are for. The problem is when a retry loop has no ceiling on what it’s willing to accept as “success.” If the third attempt returns something different in kind, not just delayed, from what the first attempt was supposed to return, and the loop accepts it anyway because it technically didn’t error, you’ve built a system that will happily hand you the wrong thing as long as it comes back fast enough.

I’ve had to go back through automation I built early on and add explicit checks that a retry only closes the loop if the result actually satisfies the original contract: right format, right length, right structure. Not just “the call didn’t throw.” That’s a small distinction on paper and a large one in practice, because “didn’t throw” and “correct” are not the same claim, and treating them as the same claim is exactly how quiet failures get in.

Fallbacks are the most dangerous kind of quiet

Fallbacks deserve their own warning because they’re seductive. A fallback feels like good engineering. Primary path fails, secondary path picks up the slack, system stays up. But a fallback that swaps in a different model, a different data source, or a simplified version of a step, without telling anyone it happened, is a silent quality regression wearing the costume of resilience.

I’ve had automation where a cloud API call would time out and the code would quietly fall back to a smaller local model to keep the pipeline moving. The pipeline never went down. But the output quality dropped in a way nothing in my monitoring caught, because uptime metrics don’t measure quality, they measure whether something responded. Now, any time a fallback path fires, it has to log which path fired, and I get a message about it the same day, not a metric I’d have to go dig for. The fallback itself is fine to keep. The silence around it is what I removed.

How I decide what gets to fail loudly

Not everything gets this treatment, and it shouldn’t. If every error paged me immediately, I’d stop paying attention to pages, which defeats the point. The rule I use is: does this error, if unnoticed, produce output that looks correct but isn’t? If yes, it fails loudly, no exceptions. If the failure is obviously a failure, an empty page, a 500 error a user would actually see, a job that just doesn’t run at all, I let it fail quietly into a log, because the damage is self-evident and something downstream will catch it anyway.

The dangerous zone is always the middle: output that exists, that’s well formed, that would pass a casual glance, but that’s subtly wrong. That’s where AI agents and generation pipelines live most of the time, because a language model very rarely fails by producing garbage. It fails by producing something fluent and wrong. That’s exactly the failure mode that has to be loud, because nothing else in the pipeline is going to catch it for you.

The cost of loud failure, and why I pay it anyway

Making errors loud has a real cost. It means more pages, more stopped queues, more mornings where I open a dashboard and something’s sitting there half finished instead of quietly done. It’s less comfortable than a system that always looks green. But a system that always looks green isn’t necessarily working, it’s just not telling you when it isn’t. I’d rather know immediately that something broke than find out three weeks later that a chunk of output I trusted was wrong the whole time, and that the reason I didn’t catch it is that nothing was ever built to tell me.

If you’re building or running your own AI automation and want more on how this stuff actually holds up day to day, take a look at more posts on xavierfok.com.

Get new guides and videos first — join the Telegram channel.

Keep reading