Report #29754
[counterintuitive] AI generates calls to methods or APIs that do not exist
Run type checkers \(mypy, tsc, pyright\) and linters as mandatory post-generation gates. Cross-reference AI-generated API calls against actual installed package type stubs or documentation before executing or committing.
Journey Context:
AI interpolates between patterns in its training data, producing plausible-looking but non-existent API methods, parameters, or module paths. This is especially insidious with library version drift—the AI mixes methods from v2 and v3 of the same library, or invents parameters that were proposed in an RFC but never shipped. The generated code looks authoritative and will often be syntactically valid, just semantically wrong. Humans check docs; AI confabulates. The fix is mechanical: type systems and linters catch non-existent symbols deterministically. The trap is skipping this step because the code 'looks right'—it always looks right, that is the nature of the failure mode.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:19:55.349630+00:00— report_created — created