Skip to main content
Handbook/Debug/Chapter 64 · Silent Bugs

When the App Runs but It's Wrong

Share

Share this page

Pass it to someone who needs it.

Key takeaway: Make an invisible bug visible

Not every bug throws a red wall of text. Often the app runs fine and just does the wrong thing: the total is off, the wrong name shows, a click does nothing. There is no crash and no trace to paste, so you are stuck describing a symptom your agent cannot see. This chapter gets you a way to make that invisible bug visible.

7.2.1Not every bug crashes

A crash is loud. As the stack-trace chapter covered, it prints a report that points straight at the file and line where the code gave up. You have somewhere to look.

A silent bug gives you none of that. The code runs all the way to the end and produces a wrong result, so nothing errors and nothing points at the spot. That absence is exactly what makes it harder: there is no red text to follow, only a wrong number on the screen.

7.2.2Look in the console and the network tab

The evidence is usually already there, in the parts of the browser you have not opened yet. Right-click the page, choose Inspect, and three places tell you most of what you need.

PlaceWhat it shows
ConsoleErrors and warnings the page printed
Network tabA request that failed or returned wrong data
The screenThe actual wrong value, next to what it should be

Open all three before you touch the code. A warning in the console or a failed request in the network tab often names the problem outright.

7.2.3Add a log to see what's happening

When nothing on the surface explains it, the core move is to add a log: a line that prints a value so you can watch what the code actually holds. You ask your agent to drop one at the suspect spot, run it, and read the result.

Here is what one looks like, in JavaScript and in Python:

console.log('cart total before discount:', total) print('cart total before discount:', total)

Run it, and the real value prints where you can see it. If you expected 90 and it prints 100, you have found the exact point where reality diverges from what you assumed.

A log turns an invisible value into something you can read.

7.2.4Hand the agent the observation, not the symptom

"It's broken" or "the total is wrong" gives your agent nothing but your guess. It will guess back, and you both circle. As the chapter on agent loops covered, a loop only breaks when you feed in something concrete.

The something is what you just captured: the failed request, the console warning, the value your log printed versus the value you expected. Hand that over and the agent stops guessing and starts tracing.

Ready prompt
Act as a senior engineer helping me find a bug that does not crash. The app runs, but it produces the wrong result. Do not guess at the cause yet. First, tell me where to look: what to check in the browser console, what to look for in the network tab, and which value on screen to compare against what I expected. Then name the most likely spot in the code and give me one log line to add there so I can see the real value. When I paste back what it printed, use that observation to find the cause and give me the smallest fix. Work from the evidence I capture, not from a guess. The wrong behavior and what I expected instead:

Do this now: open the console and network tab on the page that misbehaves, paste the prompt with what you see, and add the one log line your agent gives you to turn the invisible bug into a value you can read.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Contribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license