OpenCode repeatedly executes a command non stop #3457

Open
opened 2026-02-16 17:40:09 -05:00 by yindo · 4 comments
Owner

Originally created by @zibler on GitHub (Dec 10, 2025).

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

Originally created by @zibler on GitHub (Dec 10, 2025). ### Description I have created a commit command ([commit.md](https://github.com/user-attachments/files/24093632/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 <img width="343" height="475" alt="Image" src="https://github.com/user-attachments/assets/fa42d70b-d681-4d5e-b26c-a15caac60851" /> 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. <img width="995" height="953" alt="Image" src="https://github.com/user-attachments/assets/c58ba7ae-7cb4-4aa8-be1a-1b07a43cf4eb" /> ### 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_
yindo added the bug label 2026-02-16 17:40:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 10, 2025):

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] commented on GitHub (Dec 10, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Dec 10, 2025):

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 commented on GitHub (Dec 10, 2025): I see this with certain models, id be super surprised if u got this with sonnet 4.5 even if it wss on copilot
Author
Owner

@rekram1-node commented on GitHub (Dec 10, 2025):

any chance u can share session

@rekram1-node commented on GitHub (Dec 10, 2025): any chance u can share session
Author
Owner

@zibler commented on GitHub (Dec 11, 2025):

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 commented on GitHub (Dec 11, 2025): 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](https://github.com/user-attachments/files/24118840/session-ses_4f48.md)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3457