-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Bug: SDK Messages cause switch back to default model #4901
Description
Description
I have created a opencode plugin to give the ai context about ddev and fix command execution: https://github.com/JUVOJustin/opencode-ddev-plugin
The plugin adds context that ddev is used by executing:
await client.session.prompt({
path: { id: currentSessionId },
body: {
parts: [
{
type: 'text',
text: `➡️ DDEV environment is used. Execute commands inside the DDEV container like this: \`ddev exec --dir="${containerWorkingDir}" bash -c <command>\``,
},
],
noReply: true,
},
});This causes a user message to be written back in the context. After that message the session switches back to using the primary agents model instead of the one choosen manually using /models
Funnily enough, i noticed this during the recording of my screencast for my ddev plugin so it can be seen in action here: https://cap.so/s/xvrarkbtk9yw6qh
OpenCode version
1.0.120
Steps to reproduce
- Create session
- Switch model using /models
- Let the sdk write a message via a custom plugin
- See the session using the default model of the primary agent again
Screenshot and/or share link
https://opencode.ai/s/XAifDA71
Operating System
macOS 15.7.2
Terminal
macOS Terminal