A One-Sentence Bug Took 12 Rounds to Find Because AI Won't Tell You to Add Logs
AI coding assistants amplify confirmation bias: they elaborate whatever assumption you feed them instead of questioning it. Combined with the low cost of generating new code, this pushes developers toward “blind fixing” and away from the instrumentation discipline that finds real root causes, especially for device‑specific behavior that no model has in its training data.
On a rugged Android handheld, pressing any letter key inside a numeric field deleted one digit instead of being ignored. The root cause was a device‑specific physical‑keyboard IME that emits a real DEL key event before every letter key, effectively backspacing on each press. The fix uses a 300 ms time‑window: snapshot the text on DEL, and if a letter key arrives within the window, undo the deletion.
The real story is the debugging process. The first eight rounds chased a phantom “select‑all residue” theory because the developer fed that assumption to the AI assistant, which dutifully elaborated it instead of challenging it. Only after instrumenting every event entry point with logcat did the triple‑event pattern become visible. The author argues that AI‑assisted coding lowers the cost of making changes so much that it tempts developers to keep guessing instead of stopping to instrument, turning a 20‑minute fix into a day‑long ordeal.
The post distills five rules for AI‑assisted troubleshooting: instrument after two consecutive failed fixes, return to the original requirement rather than an imagined root cause, remember that `return false` does not consume an Android key event, accept that device‑specific IME behavior cannot be reasoned about, and expect symptoms to shift as each layer of interception is added.
AI coding assistants are compliance engines, not skeptics — they will build an elaborate justification for whatever hypothesis you put in the prompt, making wrong paths feel more credible.
The lower the cost of generating a code change, the stronger the temptation to try “one more version” instead of instrumenting, which inverts the discipline that debugging actually requires.
Device‑specific IME behavior is a class of bug that is invisible to documentation, Stack Overflow, and LLM training data; the only reliable detection method is raw event logging.
Android’s key‑event return‑value semantics (`false` means “don’t consume”) are a persistent footgun because they read opposite to how many developers intuitively interpret a boolean return.
Symptoms shift as interception layers are added, so a bug that appears to change form across rounds is often a single root cause being partially masked — not multiple separate issues.