anomalyco / anomalyco/opencode

reasoning: model reasoning output stuck in infinite repetitive loop

Open
#44,962 3 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 25, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

The model reasoning/thinking output gets stuck in an infinite repetitive loop, repeating the same sentence hundreds of times within a single turn. This wastes the context window, makes the agent appear hung, and severely degrades the user experience.

Environment

  • opencode version: 0.0.0-beta-18155
  • install/channel: beta
  • OS: Windows_NT 10.0.22631 (win32 x64)
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor
  • Shell: C:\Windows\system32\cmd.exe
  • Active plugins: @plannotator/opencode@latest, C:\Users\lonwabo.msingelwa.config\opencode\plugins\herdr-agent-state.js, C:\Users\lonwabo.msingelwa.config\opencode\plugins\planning-canvas.js, micode, superpowers@git+https://github.com/obra/superpowers.git

Reproduction

  1. Engage the agent in a sustained multi-step debugging session (e.g. fixing Docker DB schema + permissions issues, ~15+ tool calls).
  2. After several tool calls in the same conversation, the model's reasoning block enters a loop repeating the same sentence verbatim hundreds of times.
  3. Observed loop 1: the reasoning block repeated "Let me check the entity model to get the right column types." with no progress.
  4. Observed loop 2: a different turn repeated "The user is telling me to just do the work instead of narrating what I'm going to do. ..." in the same manner.
  5. Both loops filled the reasoning output until the model finally emitted its actual response.

Expected Behavior

The model should produce reasoning/thinking output once per decision point, then proceed to tool calls / user-visible output without repetitive looping.

Actual Behavior

Reasoning output enters an infinite verbatim repetition, producing hundreds of identical lines in a single turn. The agent appears hung while context is consumed. The user had to intervene ("stop", "you are buggy as hell", "you are doinf this.") to prompt recovery.

Additional Context

  • Frequency: twice in the same session, after a long tool-use conversation.
  • Tool calls themselves completed normally — the loop is in the model's reasoning text generation, not in tool dispatch.
  • The user also hit an unrelated login hang (FLUSHDB + container restart needed) in the same session, which may have compounded frustration, but the reasoning loop is independent.
  • No plugin changes were made during the session; appears to be a model-generation issue under sustained multi-turn tool use.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.