Bug: SDK Messages cause switch back to default model #3204

Open
opened 2026-02-16 17:39:06 -05:00 by yindo · 1 comment
Owner

Originally created by @JUVOJustin on GitHub (Nov 29, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @JUVOJustin on GitHub (Nov 29, 2025). Originally assigned to: @rekram1-node on GitHub. ### 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: ```ts 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
yindo added the bug label 2026-02-16 17:39:06 -05:00
Author
Owner

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

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

  • #4475: Plugins using noReply seem to cause model to switch to agent default
  • #4431: Bug: noReply pattern broken in 1.0.69+ (agent loop refactor regression)

These issues describe the exact same problem where SDK messages (via plugins using noReply: true) cause the session to switch back to the primary agent's default model instead of maintaining the manually selected model.

Feel free to ignore if your specific case differs from these reports.

@github-actions[bot] commented on GitHub (Nov 29, 2025): This issue might be a duplicate of existing issues. Please check: - #4475: Plugins using noReply seem to cause model to switch to agent default - #4431: Bug: `noReply` pattern broken in 1.0.69+ (agent loop refactor regression) These issues describe the exact same problem where SDK messages (via plugins using `noReply: true`) cause the session to switch back to the primary agent's default model instead of maintaining the manually selected model. Feel free to ignore if your specific case differs from these reports.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3204