Skip to content

AI stuck in an infinite repetition loop and fails to execute commands #46239

Closed as not planned

Description

@0xkhaledabdelaziz

I am encountering an issue where the AI assistant gets stuck in a continuous text generation loop.

As you can see in the attached screenshot ({89CEA8ED-45EE-4DD9-AF4A-AC35D3E9753D}.png), instead of executing the requested task or writing the code, the AI endlessly repeats the same Arabic phrases (repeatedly stating its intention to use the bash tool). It seems to be failing to correctly format the tool call, resulting in an infinite hallucination loop where it just narrates what it wants to do without ever actually starting the execution.

Expected Behavior:
The AI should successfully invoke the tool and execute the task instead of getting stuck in a repetitive text loop.

Activity

  1. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is the same as one of these, please add a comment there instead so the discussion stays consolidated. If it's a distinct case, please update this issue with additional details (OpenCode version, model/provider used, OS) to help differentiate it.

  2. neriousy commented on Oct 22, 2026

    @neriousy
    Member

    Closing as not planned. A model that keeps saying it will run a command but never makes the tool call is model behavior, not something OpenCode can fix on its side. Trying a different model or starting a fresh session usually helps. If you see it on a current 2.0 build with a specific model and it looks like OpenCode is dropping the tool call, open a new issue with the version, model and provider.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions