Skip to content

GLM-4.6 model gets stuck in infinite loop, repeating same actions #3444

@ElecTwix

Description

@ElecTwix

When using the GLM-4.6 model with opencode, the agent sometimes gets stuck in an infinite loop where it performs the same actions repeatedly instead of progressing through the task. This behavior doesn't occur with Claude Code or other models.

Steps to reproduce:

  1. Use opencode with GLM-4.6 model (via z.ai plan provider)
  2. Give a moderately complex task that requires multiple steps
  3. Observe that the agent starts repeating the same tool calls or actions
  4. The agent continues this loop indefinitely without completing the task

Expected behavior:

The agent should progress through the task logically, completing each step and moving to the next one, similar to how Claude Code behaves.

Actual behavior:

The GLM-4.6 model gets stuck repeating the same actions in a loop, never progressing to complete the task.

Environment:

  • Model: GLM-4.6 (z.ai plan provider)
  • Other models work fine (Claude Code, etc.)

Additional context:

This appears to be specific to the GLM-4.6 model's behavior or how it processes the opencode tool system. The issue doesn't occur with other models, suggesting it's not a general opencode bug but rather a model-specific interaction problem.

Image Image

Metadata

Metadata

Assignees

No one assigned

    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