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
Plugins using noReply seem to cause model to switch to agent default #4475
Issue: When calling a skill tool (e.g., skills_test_skill), Build mode switches from the manually selected model to its default (?) (in my case openai/gpt-oss-120b).
Expected: Model selection should remain stable when plugin tools execute.
Workaround: Explicitly set mode.build.model in opencode.json
Test skill
in e.g. ~/.opencode/skills/test-skill/SKILL.md):
name: test-skill
description: A minimal test skill to debug loading issues
Test Skill
This is a simple test skill. If you can see this, the skill loaded successfully.
Just respond with "Test skill loaded!" when called.
OpenCode version
1.0.78
Steps to reproduce
Start OpenCode without explicit mode.build.model config
Manually select Claude Haiku 4.5
Verify Build indicator shows "claude-haiku-4-5"
Call any skills_* tool
Build mode indicator switches to "openai/gpt-oss-120b"
I think the issue is maybe that resolveModel doesn't check the current session's active model before falling back to defaults, so noReply calls inherit the default model instead of the session's current selection.
changed the title [-]Calling opencode-skills tools causes Build mode to reset to default model[/-][+]Plugins using noReply seem to cause model to switch to agent default [/+]on Nov 19, 2025
Another update.
For 1.0.68 both the minimal test_noreply plugin and skills_test_skill work correctly and use the session's selected model (here Claude Haiku 4.5). Seems to be an issue introduced by the agent loop refactor and/or subsequent fixes to this, hence doesn't work for 1.0.78
The fix is working, but one thing that is interesting to point out is that the prompts sent with noReply appear to be using the build agent, instead of the agent that started the session. So the model selection problem is gone (if there isnt a default configured in opencode.json), but is it intended that the noReply pattern will always be processed by the in-built build agent?
So I just tested this. When a prompt is sent with noReply, the agent switches to build. If the build agent decides to continue, but its now a different agent and trying to run commands it doesn't have access to. It bombs like the image below. /cc @thdxr@rekram1-node
This bug also appears to impact compaction. Compaction switches to build agent, doesn't return to the agent that initiated. Build agent tries to run a tool it doesn't have access to and bombs.
Hi @omaclaren maintainer of the plugin here, the default behavior was to not provide a target agetn, as you have already discovered, now the messages are going to the build agent if non is provided. I released an update to the plugin and now it explicitly pass the message to the the agent that called the tool, it should be all fixed now at least on the plugin end. Please feel free to open an issue on the plugin repo if the issue still persists, make sure you are on the latest version
So far it is working well, but I will test it for a couple of days and if things go smoothly I will make a PR. I appreciate it if you try this patch as well and let me know if works for you too.
god bless you @arsham, I am currently wasting premium requests because of this issue right now! I will see how i can apply the patch to opencode as it updates automatically nearly every day ;D
@Nindaleth I have updated the PR. I think they both are related. I could create a separate PR but it requires testing to see if the patch itself is the fix.
Activity
rekram1-node commentedon Nov 19, 2025
prolly because of the skill plugin setting the model in its request or not using the same model
omaclaren commentedon Nov 19, 2025
Thanks but I don't think this is specific to this plugin (and I don't think the opencode-skills plugin sets a model in its requests).
To verify, here is a minimal test plugin that uses the same
noReplypattern as opencode-skills.This minimal test plugin also seems to trigger the model switch to gpt-oss-120b.
So it is maybe OpenCode's handling of
client.session.prompt({ noReply: true })calls from plugins?Built-in tools (bash, read, etc.) that don't use this pattern seem to work fine.
omaclaren commentedon Nov 19, 2025
I think the issue is maybe that resolveModel doesn't check the current session's active model before falling back to defaults, so noReply calls inherit the default model instead of the session's current selection.
omaclaren commentedon Nov 19, 2025
Updated title to reflect that this seems to affect all plugins using
noReply, not just opencode-skills[-]Calling opencode-skills tools causes Build mode to reset to default model[/-][+]Plugins using noReply seem to cause model to switch to agent default [/+]omaclaren commentedon Nov 19, 2025
Another update.
For 1.0.68 both the minimal
test_noreplyplugin andskills_test_skillwork correctly and use the session's selected model (here Claude Haiku 4.5). Seems to be an issue introduced by the agent loop refactor and/or subsequent fixes to this, hence doesn't work for 1.0.78arsham commentedon Nov 19, 2025
Related #4439 I suppose. The same agent loop refactor caused both issues.
rekram1-node commentedon Nov 19, 2025
yeah i think ur right there is something going on there
thdxr commentedon Nov 19, 2025
let me summarize the issue:
what is happening here is the loop now will use the model associated with the LAST user message
right now you can call
promptwithout specifying agent or modeland the current logic is to use the default model when that's the case
better logic would be to use the last known model from the last user message that has one - will fix
thdxr commentedon Nov 19, 2025
can you see if this is fixed in
bunx opencode-ai@dev(should be deployed 5min after this comment)wolfie82 commentedon Nov 19, 2025
The fix is working, but one thing that is interesting to point out is that the prompts sent with noReply appear to be using the
buildagent, instead of the agent that started the session. So the model selection problem is gone (if there isnt a default configured in opencode.json), but is it intended that the noReply pattern will always be processed by the in-builtbuildagent?wolfie82 commentedon Nov 19, 2025
So I just tested this. When a prompt is sent with noReply, the agent switches to build. If the build agent decides to continue, but its now a different agent and trying to run commands it doesn't have access to. It bombs like the image below. /cc @thdxr @rekram1-node
wolfie82 commentedon Nov 19, 2025
This bug also appears to impact compaction. Compaction switches to build agent, doesn't return to the agent that initiated. Build agent tries to run a tool it doesn't have access to and bombs.
omaclaren commentedon Nov 19, 2025
yeah, seems to fix the issue in build mode but if in plan mode it switches to build agent when using noReply
fix: preserve model selection when using noReply (opencode #4475)
preserve model selection when using `noReply`
malhashemi commentedon Dec 6, 2025
Hi @omaclaren maintainer of the plugin here, the default behavior was to not provide a target agetn, as you have already discovered, now the messages are going to the build agent if non is provided. I released an update to the plugin and now it explicitly pass the message to the the agent that called the tool, it should be all fixed now at least on the plugin end. Please feel free to open an issue on the plugin repo if the issue still persists, make sure you are on the latest version
omaclaren commentedon Dec 7, 2025
thanks @malhashemi -- I think this was a more general issue with opencode itself as well, but looks like there's lots of activity fixing it!
arsham commentedon Dec 7, 2025
I've used this patch to fix the issue locally:
So far it is working well, but I will test it for a couple of days and if things go smoothly I will make a PR. I appreciate it if you try this patch as well and let me know if works for you too.
binajmen commentedon Dec 12, 2025
god bless you @arsham, I am currently wasting premium requests because of this issue right now! I will see how i can apply the patch to opencode as it updates automatically nearly every day ;D
arsham commentedon Dec 12, 2025
Just to report: I haven't had a single incident after this patch on top of #4622 PR.
Nindaleth commentedon Dec 18, 2025
@arsham Would you be willing to send your patch as an independent PR so it can be reviewed by the maintainers too?
arsham commentedon Dec 19, 2025
@Nindaleth I have updated the PR. I think they both are related. I could create a separate PR but it requires testing to see if the patch itself is the fix.