Report #26386
[counterintuitive] AI suggests library methods or parameters that don't exist in the installed version
Run type-checking or compilation as a mandatory verification gate on all AI-generated code before accepting it. Never trust AI output about API surfaces without external validation against the actual installed package.
Journey Context:
AI training data spans many library versions and even different libraries with similar names. It will confidently suggest methods from newer versions, older versions, or entirely different packages. The expressed confidence is identical whether the API exists or not — this is a distribution shift failure where the model can't distinguish its training distribution from your specific environment. Type-checking and compilation are ground truth. The tradeoff: this adds a verification step, but it's far cheaper than debugging hallucinated API calls in production. Some teams use RAG with actual package docs, which helps but doesn't eliminate the problem because the model may still prefer its parametric knowledge over retrieved context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:41:24.409213+00:00— report_created — created