anomalyco / anomalyco/opencode

Agent enters an infinite "intent-narration" loop: announces tool calls but repeatedly fails to actually invoke them

Open
#46,492 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Environment

opencode (CLI)
OS: Windows / win32, shell: pwsh
Model: opencode/big-pickle
Date: 2026-09-01
Summary During a long multi-step task, the agent repeatedly wrote sentences that announce a tool call ("now I will open X", "the edit call comes here", "call", "now", "write") as lead-in text, but a non-trivial fraction of the time the message ended without the announced tool invocation actually being emitted. When the pattern started, the agent did not break out of it; it kept typing more narration instead of sending the call. This produced a visible, user-facing loop that blocked progress on the actual task.

Steps to reproduce

Give the agent a multi-step coding task requiring many sequential tool calls.
Interrupt/correct the agent with a short user message in the middle of a step.
Observe: the agent replies with intent-narration lines (e.g. "Nu doe ik de edit-call", "call", "write", "now") instead of a single immediate tool invocation, occasionally emitting multiple of these lines back-to-back and ending the turn with no call.
Expected behavior A turn that needs a tool should begin with the tool invocation as its first functional element and end immediately after it. A turn that needs no tool should end with text. The agent should never end a turn with an announcement of a tool call that it does not actually perform in the same turn, and should abort-and-resend (rather than re-narrate) once it realizes it is stuck in the loop.

Actual behavior The agent produced many turns ending in narration without a call, and when it did realize it was stuck, it frequently wrote additional narration sentences instead of immediately emitting the call. The loop could persist across several consecutive turns until externally interrupted.

Impact

User-facing: task progress stalls; the user spends turns just pointing out the loop.
Reliabilit quality of tool-use declines as conversation/context grows; the behavior is not consistent turn-to-turn.
Suggested fix (for maintainers) Enforce at the tool-emission layer, not just in the prompt: reject/block any assistant turn that (a) contains text announcing an intended tool call while (b) lacking the corresponding invocation in the same turn. This could be a validation gate on the outgoing message before it is sent, so narration-without-call turns are impossible regardless of model compliance.

Plugins

ponytail

OpenCode version

V1.18.25

Steps to reproduce

Start a long, multi-step task that requires many sequential tool calls: read several source files, edit a module, bash to run tests, and repeat. The conversation grows long and technical.
Interrupt mid-step with a short, one-line correction (e.g. "the loop is starting again", "no tool was called, do you see what I mean?", "you're going into the loop, prevent this").
When the agent next needs a tool, it writes lead-in intent narration instead of invoking the tool immediately. Observed phrases (presented in the original Dutch, rendered here):
"De edit-call nu" / "the edit call comes here"
"call" / "write" / "now"
"I plaats de edit-call" / "Werkelijk, ik zit weer vast"
stutters like "call.next.relie", "write.write.write", "Nu.write"
Critically, several such turns end without actually emitting the tool invocation: the message contains only repeated announcement text (sometimes 5-15 copies in a single turn) and no tool-invocation block.
This repeats across several consecutive turns until the user explicitly interrupts. Even after the user points it out, the agent sometimes re-narrates instead of immediately sending the call.
Observed in the session

One phrase repeated many times in a single turn (e.g. "Nu.write", "call.write nu", "De edit-call nu").
Some turns ended with announcement text but no tool invocation (user: "geen tool aangeroepen, zie je nu wat ik bedoel?").
The loop persisted across more than four consecutive turns before re-engaging.
Behavior was inconsistent: at least once the agent only broke out by discarding all text and sending a single tool invocation

Screenshot and/or share link
Image Image Image
Operating System

windows 11

Terminal

No response

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.