Skip to content
Andrews Dean
← Field Notes
July 1, 20263 minShipping AI you can trust

The bug that remembered the wrong thing

A system that silently does the wrong thing is more dangerous than one that visibly does nothing. Here's how I nearly shipped one.

What the cache remembered

The most dangerous bug I caught this year wasn't a crash. It was a system quietly remembering the wrong thing.

A sensible idea, saving real money

Here's the setup. The receipt reader I'd built calls an AI model on every file, and every call costs money. So I gave it a simple memory: before every call, check "have I asked this exact thing before?" If yes, reuse the old answer for free.

Sensible. It saves real money. I ran a batch, it cost 7 cents. Ran the identical batch again, and it cost $0.00. Everything came from memory. Beautiful.

The quiet flaw

Except the first version had a quiet flaw. It reused any earlier attempt, including the ones that had failed. A dropped connection. A server hiccup that had nothing to do with the receipt.

So if the AI ever failed to answer for one receipt, even once, even for a silly network reason, the system filed that failure away as the permanent answer. Forever.

A normal caching bug returns data that's stale. That's annoying, but it's at least real data from a real answer. This one was worse. It manufactured an answer that never existed, then defended it with total confidence, because as far as the cache was concerned, the question was already settled.

Think of an assistant who calls a client, the line drops, and he writes "client had nothing to say" in the record, then refuses to ever call again because, as far as his notes go, he already asked. That was my cache.

It didn't have an answer. It had a ghost. And from the outside, a system confidently serving a ghost looks identical to one that works.

Caught by a second pair of eyes

A second reviewer caught it before it shipped. The fix was one line: only remember an answer if the AI actually answered. If the call never completed, that's not a real answer worth keeping. Try again next time.

The lesson stuck harder than the fix, so let me say it straight: a system that silently does the wrong thing is more dangerous than one that visibly does nothing. "Nothing" at least announces itself.

What the bug actually taught me

The fix was one line. The harder question is the one it left behind: what else in this system remembers something it never actually learned?

I run the same three questions over every caching layer I build now, not just this one. What does a wrong cached answer cost. Who would catch it. And how long would that take. A cache that fails loud, an error, a retry, a blank, is the cheap kind. A cache that fails quiet and confident is the expensive kind, and it's the kind that survives until someone three steps downstream trusts it.

This is why "it's working" isn't a status I trust anymore. Working how? On the happy path, or on the day the network blips at 2am?

The failures that scare me don't throw errors. They remember. Which of your systems is quietly remembering a ghost right now?

aiproduct-managementqualityengineering-judgment

Contact

Let's talk.

If you're building an AI-first product org — or you need someone who can take a vague mandate and return a shipped, adopted product — I'd like to hear about it.

hello@andrewsdean.com · Noida (Delhi NCR), India