Tool calling when using opencode-skills plugin seem to loop and fail. #2749

Closed
opened 2026-02-16 17:37:05 -05:00 by yindo · 13 comments
Owner

Originally created by @DamianPereira on GitHub (Nov 10, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Original issue: https://github.com/malhashemi/opencode-skills/issues/27#issuecomment-3508905810

Hi! I've noticed that when using this plugin, tool calling seems to be broken, tool calling seems to keep calling the same tool over and over again after each response. Deep details are on the ticket I reported to the plugin, which was closed as not solve since it looks like a tool error.

But the clearest and most actionable example I have is using the brainstorming skill, with grok model like this: https://opencode.ai/s/gYW6TggF

Main problem:

The skill loaded again? This seems like a loop.
Evaluating Skill Behavior
The skill appears to be reloading, suggesting a potential loop in the process.

Other repros

  • I have also found similar problems when using minimax m2 (free) from openrouter: https://opencode.ai/s/1Xpf1G9F
  • Interestingly, big pickle handles this workflow perfectly, asking 1 quesiton at a time, and never reloading the skill: https://opencode.ai/s/tY09Wyyq, qwen3-coder from opencode zen seems to be handling it as well.

It looks like it's happening with smaller models, but also with minimax m2.

OpenCode version

1.0.46, latest available in brew.

Steps to reproduce

Install and enable https://www.npmjs.com/package/opencode-skills
Try to use https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md to create a design doc

Operating System

Mac OS 15.6.1 (24G90)

Terminal

Iterm 2

Originally created by @DamianPereira on GitHub (Nov 10, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Original issue: https://github.com/malhashemi/opencode-skills/issues/27#issuecomment-3508905810 Hi! I've noticed that when using this plugin, tool calling seems to be broken, tool calling seems to keep calling the same tool over and over again after each response. Deep details are on the ticket I reported to the plugin, which was closed as not solve since it looks like a tool error. But the clearest and most actionable example I have is using the brainstorming skill, with grok model like this: https://opencode.ai/s/gYW6TggF Main problem: > The skill loaded again? This seems like a loop. > Evaluating Skill Behavior > The skill appears to be reloading, suggesting a potential loop in the process. ### Other repros * I have also found similar problems when using minimax m2 (free) from openrouter: https://opencode.ai/s/1Xpf1G9F * Interestingly, big pickle handles this workflow perfectly, asking 1 quesiton at a time, and never reloading the skill: https://opencode.ai/s/tY09Wyyq, qwen3-coder from opencode zen seems to be handling it as well. It looks like it's happening with smaller models, but also with minimax m2. ### OpenCode version 1.0.46, latest available in brew. ### Steps to reproduce Install and enable https://www.npmjs.com/package/opencode-skills Try to use https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md to create a design doc ### Operating System Mac OS 15.6.1 (24G90) ### Terminal Iterm 2
yindo added the model-problem label 2026-02-16 17:37:05 -05:00
yindo closed this issue 2026-02-16 17:37:05 -05:00
Author
Owner

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

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

  • #4112: [MiniMax M2 via OpenRouter] Incorrect side panel title & agent stop at the middle of the work - This issue specifically mentions MiniMax M2 via OpenRouter having problems where the agent stops in the middle of work and requires manual "Please continue" responses, which sounds very similar to the looping/reloading behavior you're experiencing.
  • #4042: Tool calls abort, fail, syntax error - While this is about JSON syntax errors rather than loops, it's another tool calling failure issue that might be related.

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

@github-actions[bot] commented on GitHub (Nov 10, 2025): This issue might be a duplicate of existing issues. Please check: - #4112: [MiniMax M2 via OpenRouter] Incorrect side panel title & agent stop at the middle of the work - This issue specifically mentions MiniMax M2 via OpenRouter having problems where the agent stops in the middle of work and requires manual "Please continue" responses, which sounds very similar to the looping/reloading behavior you're experiencing. - #4042: Tool calls abort, fail, syntax error - While this is about JSON syntax errors rather than loops, it's another tool calling failure issue that might be related. Feel free to ignore if none of these address your specific case.
Author
Owner

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

@DamianPereira is this an issue with opencode or with the skills plugin? We dont maintain the plugin so I don't think this is a bug on our end?

@rekram1-node commented on GitHub (Nov 10, 2025): @DamianPereira is this an issue with opencode or with the skills plugin? We dont maintain the plugin so I don't think this is a bug on our end?
Author
Owner

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

Oh I see ur comment, so this is just a model calling the same tool multiple times?

We do have some detection to try and prevent that but ultimately that is up to the model, better ones tend to not loop on the same call over and over

Free models from openrouter commonly have issues like this

@rekram1-node commented on GitHub (Nov 10, 2025): Oh I see ur comment, so this is just a model calling the same tool multiple times? We do have some detection to try and prevent that but ultimately that is up to the model, better ones tend to not loop on the same call over and over Free models from openrouter commonly have issues like this
Author
Owner

@DamianPereira commented on GitHub (Nov 10, 2025):

I thought it was a plugin level issue and reported there, but I got sent here since it was probably an opencode level issue.

Is there a way to prevent tool calling to "pose" as the user? A lot of models seem to get confused when calling tools and understand the response as the user themselves. Or try to talk with the tool instead of with the user.

The looping is not so bad, but the main issue is that with multi step process it tends to fast-forward like the minimax m2 logs I attached, (go through many steps of the main process just repeating the tool).

@DamianPereira commented on GitHub (Nov 10, 2025): I thought it was a plugin level issue and reported there, but I got sent here since it was probably an opencode level issue. Is there a way to prevent tool calling to "pose" as the user? A lot of models seem to get confused when calling tools and understand the response as the user themselves. Or try to talk with the tool instead of with the user. The looping is not so bad, but the main issue is that with multi step process it tends to fast-forward like the minimax m2 logs I attached, (go through many steps of the main process just repeating the tool).
Author
Owner

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

wdym by this?

Is there a way to prevent tool calling to "pose" as the user

@rekram1-node commented on GitHub (Nov 10, 2025): wdym by this? > Is there a way to prevent tool calling to "pose" as the user
Author
Owner

@DamianPereira commented on GitHub (Nov 10, 2025):

Managed to reproduce something similar, it actually kept working through it: https://opencode.ai/s/ZFFNXrie

You can see that after succesfully generating the right approach (ask the first question), instead of answering on the main chat, it runs another tool call to the same tool. It's like once it loads the tool it stays "inside" that tool.

Maybe posing by the user is not the right explanation, it's more like "it starts talking with the skill instead of to me"

skills_brainstorming
description
Understanding Tic Tac Toe Platform Scope
prompt
Ask this question to the user: What's the primary purpose and scope of your tic tac toe platform? A) Simple single-player game for casual play B) Multiplayer platform for competitive play with rankings C) Educational tool to teach programming/game theory D) Full-featured gaming platform with tournaments and social features Please choose one option and let me know if none perfectly match your vision, or if you want something different.

It's like it's trying to use the tool in a way that it doesn't make sense. Every time you answer something, it will go back to the tool and keep trying to use it.

@DamianPereira commented on GitHub (Nov 10, 2025): Managed to reproduce something similar, it actually kept working through it: https://opencode.ai/s/ZFFNXrie You can see that after succesfully generating the right approach (ask the first question), instead of answering on the main chat, it runs another tool call to the same tool. It's like once it loads the tool it stays "inside" that tool. Maybe posing by the user is not the right explanation, it's more like "it starts talking with the skill instead of to me" > skills_brainstorming > description > Understanding Tic Tac Toe Platform Scope > prompt > Ask this question to the user: What's the primary purpose and scope of your tic tac toe platform? A) Simple single-player game for casual play B) Multiplayer platform for competitive play with rankings C) Educational tool to teach programming/game theory D) Full-featured gaming platform with tournaments and social features Please choose one option and let me know if none perfectly match your vision, or if you want something different. It's like it's trying to use the tool in a way that it doesn't make sense. Every time you answer something, it will go back to the tool and keep trying to use it.
Author
Owner

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

@DamianPereira but that seems like a bug with the skills implementation right?

@rekram1-node commented on GitHub (Nov 10, 2025): @DamianPereira but that seems like a bug with the skills implementation right?
Author
Owner

@DamianPereira commented on GitHub (Nov 10, 2025):

I thought so at first, but from the plugin maintainer (@malhashemi ):

To clarify: the plugin only exposes a tool as described in SKILL.md. It cannot initiate or force tool calls, whether and how a tool is invoked is entirely up to the model. Given that, this looks like a model/integration issue and would be better tracked in the OpenCode repo.

@DamianPereira commented on GitHub (Nov 10, 2025): I thought so at first, but from the plugin maintainer (@malhashemi ): > To clarify: the plugin only exposes a tool as described in SKILL.md. It cannot initiate or force tool calls, whether and how a tool is invoked is entirely up to the model. Given that, this looks like a model/integration issue and would be better tracked in the OpenCode repo.
Author
Owner

@malhashemi commented on GitHub (Nov 10, 2025):

Hi @rekram1-node to clarify this, it is as you suggested is probably a model issue. I referred him to track the issue here so we keep track of which models are performing poorly with tool use. Not sure if you can do anything about it though.

As for @DamianPereira the behaviour of presenting skill as user message is by design as this is how you avoid tool call responses getting purged in longer context and how Claude Code does it, if you want to get the skill as a tool response feel free to pin the plugin to an older release, see the readme on the plugin repo for instructions.

@malhashemi commented on GitHub (Nov 10, 2025): Hi @rekram1-node to clarify this, it is as you suggested is probably a model issue. I referred him to track the issue here so we keep track of which models are performing poorly with tool use. Not sure if you can do anything about it though. As for @DamianPereira the behaviour of presenting skill as user message is by design as this is how you avoid tool call responses getting purged in longer context and how Claude Code does it, if you want to get the skill as a tool response feel free to pin the plugin to an older release, see the readme on the plugin repo for instructions.
Author
Owner

@DamianPereira commented on GitHub (Nov 10, 2025):

Is there a chance that we can have a new kind of response type in opencode that works like "remember this and keep going" or rather than "this is that the user is saying" like current plugin does?

Or maybe a way for tools to attach themselves so they get sent at the end of every prompt.

@DamianPereira commented on GitHub (Nov 10, 2025): Is there a chance that we can have a new kind of response type in opencode that works like "remember this and keep going" or rather than "this is that the user is saying" like current plugin does? Or maybe a way for tools to attach themselves so they get sent at the end of every prompt.
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

that sounds kinda like system reminders

@rekram1-node commented on GitHub (Nov 11, 2025): that sounds kinda like system reminders
Author
Owner

@taqtiqa-mark commented on GitHub (Nov 22, 2025):

Also will help to document if this aims to be drop-in compatible with Claude plugins, or if they need to be ported to OC?

@taqtiqa-mark commented on GitHub (Nov 22, 2025): Also will help to document if this aims to be drop-in compatible with Claude plugins, or if they need to be ported to OC?
Author
Owner

@DamianPereira commented on GitHub (Feb 10, 2026):

Forgot to circle back on this, but the same models that used to fail are much more consistent with the native opencode skills implementation. This is no longer a problem.

@DamianPereira commented on GitHub (Feb 10, 2026): Forgot to circle back on this, but the same models that used to fail are much more consistent with the native opencode skills implementation. This is no longer a problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2749