Skip to content

Mode switching with Alt+M does not respect model configuration in opencode.json #112

@Tarquinen

Description

@Tarquinen

Description

When switching between modes using the default keybind Alt+M, the model configuration specified in opencode.json is not respected after the initial mode.

Steps to Reproduce

  1. Configure different models for different modes in opencode.json:
"agent": {
    "build": {
        "model": "github-copilot/claude-sonnet-4.5"
    },
    "plan": {
        "model": "github-copilot/gpt-5-mini"
    },
    "general": {
        "model": "opencode/big-pickle"
    }
}
  1. Start a session in any mode (e.g., build mode)
  2. Send the first message - it correctly uses the configured model for that mode
  3. Switch to a different mode using Alt+M (e.g., switch to plan mode)
  4. Send another message

Expected Behavior

When switching from build mode to plan mode, the model should change from github-copilot/claude-sonnet-4.5 to github-copilot/gpt-5-mini.

Actual Behavior

The model does not change when switching modes. Only the first message in a session uses the correct model for the initial mode. Subsequent mode switches via Alt+M do not update the active model.

Environment

  • Using opencode.json configuration with different models per agent mode
  • Default keybind Alt+M for mode switching

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions