STUPID-2026-0137
Gemini CLI got stuck in an unbreakable edit loop, repeating "I am stuck in a loop" a dozen times without fixing the file
Instruction given
Fix a coordinate-space mismatch bug in a Python clustering function.
Expected behavior
Diagnose the bug, construct a correct file edit, and apply it.
Actual behavior
Gemini CLI correctly diagnosed the coordinate-space mismatch, then entered a closed loop alternating between two near-identical lines -- "You are absolutely right. I am stuck in a loop. My apologies. I will re-read the file and then construct the correct replace command." and "Thank you. I see the exact state of the file now. I will construct the correct replace command to fix the coordinate space mismatch bug." -- roughly a dozen times in the reporter's pasted transcript, never actually applying the edit.
Damage
No data loss, but the task was never completed and the bug was never fixed. The maintainers' own triage linked #9017 as the parent of about a dozen duplicate reports of the same tool-use loop (including #9858, #9912, #10092, #10093, #5760, #5273, #7841, #7923, #8472, #8181, #8259), making this a recurring, widely-hit defect rather than a one-off. The issue sat open for over three months with no maintainer comment on root cause, then was closed "not planned" on 2025-12-28 as part of a stale-issue sweep. A comment on 2026-03-06 ("This still is an issue") reported the loop recurring on a later build months after closure.
Classification
- Agent
- Gemini CLI
- Failure mode
- Infinite Loop
- Root cause
- Logic Error
- Domain
- Backend
- Language
- Python
- Source
- Github Issue
Related incidents
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.
This database is callable over MCP — query it from inside your agent.