Report #89954
[synthesis] Model generates code with hallucinated or outdated dependencies
For Claude, explicitly list the available standard library modules or provide API docs in the context. For GPT-4o, instruct 'Only use well-known, existing PyPI packages' and verify imports. For Gemini, specify the exact version of the libraries to use in the system prompt.
Journey Context:
Code generation agents often fail at runtime due to import errors. The failure signatures differ: Claude's training leads it to confidently invent plausible stdlib extensions; GPT-4o invents plausible third-party libraries; Gemini relies on older training data, producing deprecated calls. A cross-model coding agent cannot just say 'write valid Python'. It must constrain the dependency space based on the specific model's hallucination vector: stdlib for Claude, PyPI for GPT-4o, and versioning for Gemini.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T09:34:48.166251+00:00— report_created — created