Dev.to
7/15/2026

My Demo Script Found a Production Bug on Its First Run: A Tiny Post-Mortem
Short summary
A demo script for an MCP server wrapping Google's Gemini image model caught a production bug on first run: the server's local allowlist of thinking levels (minimal, low, medium, high) didn't match the actual API contract (low, high only). The default value 'medium' would have caused every live call without an explicit override to fail with HTTP 400. Mocked tests couldn't catch this because they validated the server's internal logic, not the remote API's real contract.
- •Local validation allowlist drifted from the real API contract, causing guaranteed 400 errors on default calls
- •Mocked tests validated server logic but couldn't detect remote contract mismatches
- •Fix: align local allowlist with actual API-supported values and avoid duplicating remote contracts locally
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



