Skip to content

'A potential loop was detected' error renders Gemini CLI unusable and interrupts legitimate repetitive tasks #8234

Description

@DavidSuarez2025

What happened?

I am constantly receiving the error:

ℹ A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted.

This occurs in all sessions, especially when trying to execute repetitive tasks such as data analysis operations, reading tools, file edits, and any automation process requiring multiple similar actions in a row. Previously, I could perform these tasks without problems, but now the tool has become unusable: I can't do anything, every attempt ends with the error message and the session is halted.

What did you expect to happen?

I expect Gemini CLI to distinguish between real infinite loops and legitimate processes that require repetitive operations, such as data analysis or multiple edits. Right now, it's not possible to use it for any practical purpose.

Client information

  • CLI version: [fill in your version]
  • Operating System: [fill in your OS]
  • Model: gemini-2.5-pro

Login information

No response

Anything else we need to know?

I have reviewed similar issues such as #5761, #5440, and #5085, and the problem continues to occur. It is essential to review and improve the logic for detecting false positive loops, since the tool prevents any real work involving legitimate analysis or automation processes.

Activity

  1. gemini-cli commented on Sep 10, 2025

    @gemini-cli
    Contributor

    The issue describes a bug where aggressive loop detection renders the CLI unusable for legitimate repetitive tasks, which falls under 'area/models'. The priority is initially high (P1) due to the severity of the impact ('unusable'), but is downgraded to P2 because essential information is missing. The 'status/need-information' label is added to request the user's CLI version and operating system. Could you please provide the output of the /about command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions