Demo Script Exposed a Silent Production Bug Hidden Behind Mocked Unit Tests
A developer building a demo script for an MCP server project discovered a critical production bug on its very first run, when the live Google Gemini API rejected the value 'minimal' as an unsupported thinking level. The server's local validation layer had been approving four thinking level values — including the default 'medium' — that the real API never accepted, meaning every default API call in production was silently returning an HTTP 400 error. All ten unit tests had passed because they mocked the API client, which cannot detect mismatches between local assumptions and actual remote contracts. The incident highlighted a fundamental risk of maintaining local copies of externally owned API constraints, as such copies can drift without any internal test catching the discrepancy. The bug was resolved in roughly ten minutes, but the developer documented the post-mortem as a reminder to validate assumptions against live APIs, not just mocked ones.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in