It also happened to me in the gemini-cli. It tried to think but somehow failed and putted all thoughts into the output and tried again and again to switch to "user output". If was practically stuck in an infinite loop
> "A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted."