opencode icon indicating copy to clipboard operation
opencode copied to clipboard

OpenCode repeatedly executes a command non stop

Open zibler opened this issue 1 month ago • 4 comments

Description

I have created a commit command (commit.md) I used to automatically create commits. Usually after I am done making changes, I call this command with /commit. Most of the time it works fantastic. However, every once in a while it goes into a loop continuously committing the same thing over and over again. See below my git history

Image

You can see the session just keeps executing the command. It is entirely possible this maybe my command definition or even the model of my choosing, so I apologize if this is not a bug. The screen shot below shows how the command had pushed the code to my git repo, and immediately after that, began the process again.

Image

OpenCode version

1.0.143

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Linux Debian 12

Terminal

No response

zibler avatar Dec 11 '25 04:12 zibler

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

  • #3743: Loop in certain models (models getting stuck in loops with repeated tool calling)
  • #3458: Duplicate Executions in Kimi K2 Model (model executing same request multiple times)
  • #4158: Tool calling when using opencode-skills plugin seem to loop and fail (similar looping behavior with certain models)

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 11 '25 04:12 github-actions[bot]

I see this with certain models, id be super surprised if u got this with sonnet 4.5 even if it wss on copilot

rekram1-node avatar Dec 11 '25 04:12 rekram1-node

any chance u can share session

rekram1-node avatar Dec 11 '25 04:12 rekram1-node

You are correct. I use different models depending on the task I am doing for this commits I use opencode/grok-code. Note that I usually run some agent using some model, and then call commit. Often times after calling commit, I immediately create a new session to start working on something else, while the older session finishes its work. I don't know if this has something to do or not.

Here is the session. I did an export. Hopefully, this is what you mean.

session-ses_4f48.md

zibler avatar Dec 12 '25 03:12 zibler