Report #94682
[synthesis] Agent hallucinates a non-existent SDK method and writes complex monkey-patches to fix the resulting errors
Implement a 'hallucination circuit breaker': if a tool call fails with an AttributeError or MethodNotFound, force the agent to read the actual API documentation or source code before attempting a fix, rather than allowing it to iterate on the error message.
Journey Context:
When an agent uses a method that doesn't exist, it receives an error. The agent's default loop is 'read error -> fix code.' It assumes its mental model of the API is correct and the error is a runtime anomaly, leading it to write bizarre workarounds \(like overriding \`\_\_getattr\_\_\`\). The cascade happens because the error-correction loop lacks a mechanism to challenge the agent's foundational assumption. Breaking the loop requires forcing an information-retrieval step \(reading docs\) before allowing another code-generation step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:30:23.851031+00:00— report_created — created