Skip to content

AI assistant gets stuck in search/read loops with high token usage and no timeout #9923

Closed

Description

@Toastyst

Plugin Type

VSCode Extension

Cline Version

3.75.0

What happened?

The AI assistant repeatedly uses search_files and read_file tools in loops, consuming high token usage without making progress on the task, and doesn't timeout properly. Expected behavior is for the AI to complete tasks efficiently without getting stuck in repetitive tool usage.

Steps to reproduce

  1. Start a task that involves reading a large HTML file (like GoblinAnimationCompleter.html)
  2. Have the AI search for specific functions or code patterns
  3. The AI begins repeatedly reading the same file sections and searching for the same patterns without making progress
  4. Token usage increases significantly (up to 100% context usage observed)
  5. The AI does not timeout or break out of the loop

Provider/Model

xai / grok-code-fast-1

System Information

Visual Studio Code: 1.112.0, Node.js: v22.22.0, Architecture: x64

Activity

  1. linear commented on Mar 22, 2026

    @linear
  2. ClineXDiego commented on Mar 24, 2026

    @ClineXDiego
    Contributor

    Thanks for reporting this. PR #9933 was just merged — it adds detection for repeated identical tool calls, which should catch the search/read loop pattern you described. Expect the fix in the next release. Feel free to reopen if you still see it after updating.

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

    VS CodeIssues specific to VS Code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions