Dev.to
7/15/2026

Smash Story: The Demo Script That Out-Debugged My Test Suite
Short summary
A debugging story where a demo script caught a production bug that 10/10 passing unit tests missed: an MCP server's local validation allowed thinking levels the live Gemini API rejected. The root cause was a cached copy of the API's allowed values that had drifted, and mocks that faithfully forwarded invalid inputs without testing the real contract. The fix aligned the local allowlist with the live API and added a regression test.
- •Demo script found a production bug that all unit tests missed: stale thinking-level allowlist vs live Gemini API
- •Mocks validated the server's forwarding behavior but not the real API contract, hiding the invalid default
- •Fix aligned local validation with live API values and added regression test to prevent drift
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



