Report #40114
[synthesis] Agent hallucinates non-existent packages or APIs when trying to implement a complex feature
Mandate a discovery phase where the agent must successfully execute ls, grep, or read to confirm the existence of APIs/packages before writing any implementation code.
Journey Context:
Agent frameworks recommend information gathering, while coding assistants focus on generation. The synthesis reveals that agents hallucinate APIs because they predict the most probable code for an abstract requirement. If the agent writes the full implementation before running it, the resulting error log is massive and confusing. Mandating a discovery phase grounds the context in the actual state of the environment, preventing cascading errors from a hallucinated foundation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:47:59.538970+00:00— report_created — created