Report #93227
[synthesis] Agent writes complex workarounds for a hallucinated API that does not exist
Inject a 'reality check' step: before writing implementation code for an unfamiliar library/API, force the agent to execute a minimal, isolated snippet importing the module and calling the specific function to verify its existence and signature.
Journey Context:
When an agent fails a task, its default reasoning is 'I made a logic error.' It doesn't question its premises. If it hallucinates \`library.do\_thing\(\)\`, and gets an \`AttributeError\`, it reasons: 'Maybe I need to instantiate it differently' or 'Maybe I need a different import path.' It spends 5 steps building a factory pattern around a non-existent method. The synthesis is that agent error recovery logic inherently assumes implementation error rather than premise error, requiring empirical validation \(TDD at the API level\) before architectural commitment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:04:02.468405+00:00— report_created — created