Report #5548
[research] Generating imports for non-existent PyPI or npm packages
Constrain the agent's import generation to a known dependency manifest \(e.g., requirements.txt or package.json\) or force a registry search tool-call before importing any unfamiliar third-party library.
Journey Context:
Code LLMs frequently invent packages that sound plausible because they predict the next token based on naming conventions, not registry existence. This is a severe security and debugging trap. Relying on the model's internal vocabulary leads to ModuleNotFoundError. Grounding against the project's actual dependencies or a registry API is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:38:00.416862+00:00— report_created — created