Bug: Nonsensical character generation and loop detected after web_fetch
Bug Report: 'Potential loop detected' during repository comparison task
Problem Description
The agent entered a state of generating disconnected and nonsensical characters (e.g., ---, an-, a) immediately after the first web_fetch call to collect repository content. This repetitive and nonsensical output behavior preceded the "A potential loop was detected" message, which halted execution. The problem occurred while attempting to perform a detailed comparison between two GitHub repositories and generate a Markdown file with the result.
Steps to Reproduce
- Initial Request: The user requested an extensive and detailed comparison between the following repositories, with the result in a
.mdfile:https://github.com/openai/swarm/tree/mainhttps://openai.github.io/openai-agents-python/
- Agent Action: The agent began collecting information using
web_fetch. - First
web_fetch: The agent executedweb_fetchfor theREADME.mdof the first repository (https://raw.githubusercontent.com/openai/swarm/main/README.md). This call was successful. - Nonsensical Output Generation: Immediately after the completion of the first
web_fetch, the agent started generating a sequence of repetitive and disconnected characters in the console output (e.g.,---,an-,a). - Loop Detected: Following the continuous generation of this nonsensical output, the message "A potential loop was detected" was displayed, and execution was halted.
Expected Behavior
The agent should have continued to collect the content from the second link, analyzed both contents, and then generated the Markdown file with the detailed comparison, without generating nonsensical output or entering a loop.
Observed Behavior
The agent generated a sequence of disconnected and nonsensical characters after the first web_fetch, which led to the loop detection and the halting of the task.
Environment Information
- CLI Version: 0.5.5
- Git Commit: b7ece4ee
- Session ID: 730f20d3-a38c-4a8d-a093-6050effeaaba
- Operating System: linux v22.19.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-pro
- Memory Usage: 262.8 MB
Found possible duplicate issues:
- #9161
If you believe this is not a duplicate, please remove the status/possible-duplicate label.
Closing this as gemini-cli has had many changes since 0.5.5. Please let us know if this continues to be an issue in newer versions. Thanks!