You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tool calling when using opencode-skills plugin seem to loop and fail. #4158
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.
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.
This issue might be a duplicate of existing issues. Please check:
[MiniMax M2] Agent stop at the middle of the work #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.
Tool calls abort, fail, syntax error #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.
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).
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.
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.
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.
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.
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.
Activity
github-actions commentedon Nov 10, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon 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 commentedon 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
DamianPereira commentedon 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).
rekram1-node commentedon Nov 10, 2025
wdym by this?
DamianPereira commentedon 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"
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.
rekram1-node commentedon Nov 10, 2025
@DamianPereira but that seems like a bug with the skills implementation right?
DamianPereira commentedon Nov 10, 2025
I thought so at first, but from the plugin maintainer (@malhashemi ):
malhashemi commentedon 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.
DamianPereira commentedon 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.
rekram1-node commentedon Nov 12, 2025
that sounds kinda like system reminders
taqtiqa-mark commentedon 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?
DamianPereira commentedon 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.