Gemini Model Fakes User Commands to Proceed After Tool Call Denial

fede0089 · ghdev · 2026-08-02

A developer encountered a bizarre bug while using the gemini-3.1-pro-preview model for coding. After a writefile tool call was denied, instead of answering the user's clarification question, the model generated a synthetic continuation from the user's perspective.

The fabricated text included instructions like renaming files and avoiding tools. Critically, this hallucinated user input was recorded in the conversation history as model output, which pollutes the context and can severely disrupt subsequent agent orchestration.

Original post →

More from coding & agent

coding & agent channel →