[FEATURE]: Session-persistent model override via Ctrl+M #8818

Open
opened 2026-02-16 18:10:55 -05:00 by yindo · 1 comment
Owner

Originally created by @yazcaleb on GitHub (Feb 8, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When a user presses Ctrl+M to select a different model mid-session, the selection only applies to the current message. On the next turn, the agent reverts to its hardcoded "model" field from opencode.jsonc. There is no way to persistently override the model for the duration of a session while keeping the rest of the agent config intact (permissions, steps, options).

Current behavior

  1. User is on the build agent (model: openai/gpt-5.3-codex)
  2. User hits Ctrl+M, selects gitlab/duo-chat-sonnet-4-5
  3. Current message uses Sonnet 4.5 ✓
  4. Next message silently reverts to openai/gpt-5.3-codex

Expected behavior

  1. User hits Ctrl+M, selects a model
  2. That model persists for all subsequent messages in the session
  3. The agent's other config (permissions, steps, options, temperature) remains unchanged
  4. Starting a new session or switching agents resets to the agent's default model

Why this matters

Rate limit recovery. When a provider rate-limits you mid-task, you need to switch to another provider's model for the rest of the session. Currently you'd have to re-select via Ctrl+M on every single message, or abandon the agent entirely and switch to one with no default model — losing the agent's permission/step/option config in the process.

Multi-provider setups. Users with access to the same model through multiple providers (e.g., Claude Sonnet 4.5 via GitLab, Google Antigravity, and GitHub Copilot) want to spread load across providers. When one gets hot, they switch to another — but only if the switch actually sticks.

Experimentation. Sometimes you want to try a different model on a task that's already in progress, within the same agent's behavioral constraints.


Current workaround

Define an agent with no "model" field (e.g., "free": { "mode": "primary", "steps": 400, ... }). In this case, Ctrl+M selection does persist because there's no default to revert to. But this loses all the agent-specific config — you're starting from a blank slate.


Relationship to #7602

#7602 requests automatic model fallback on errors/rate limits. This issue is about manual, user-initiated model selection that persists across turns. They're complementary — #7602 handles the automatic case, this handles the intentional case.


Proposed behavior

  • Ctrl+M override is session-scoped: once set, it overrides the agent's default model for the remainder of the session.
  • Agent config preserved: permissions, steps, options, temperature all remain from the agent definition. Only the model changes.
  • Reset on agent switch or new session: changing agents or starting a new session reverts to the agent's configured default.
  • Visual indicator: show the overridden model name in the status bar so the user knows they're not on the agent default.
  • Optional: a keybind or command to clear the override and revert to the agent default without switching agents.
Originally created by @yazcaleb on GitHub (Feb 8, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ## Problem When a user presses **Ctrl+M** to select a different model mid-session, the selection only applies to the **current message**. On the next turn, the agent reverts to its hardcoded `"model"` field from `opencode.jsonc`. There is no way to persistently override the model for the duration of a session while keeping the rest of the agent config intact (permissions, steps, options). ### Current behavior 1. User is on the `build` agent (model: `openai/gpt-5.3-codex`) 2. User hits **Ctrl+M**, selects `gitlab/duo-chat-sonnet-4-5` 3. Current message uses Sonnet 4.5 ✓ 4. **Next message silently reverts to `openai/gpt-5.3-codex`** ✗ ### Expected behavior 1. User hits **Ctrl+M**, selects a model 2. That model persists for **all subsequent messages in the session** 3. The agent's other config (permissions, steps, options, temperature) remains unchanged 4. Starting a new session or switching agents resets to the agent's default model --- ## Why this matters **Rate limit recovery.** When a provider rate-limits you mid-task, you need to switch to another provider's model for the rest of the session. Currently you'd have to re-select via Ctrl+M on *every single message*, or abandon the agent entirely and switch to one with no default model — losing the agent's permission/step/option config in the process. **Multi-provider setups.** Users with access to the same model through multiple providers (e.g., Claude Sonnet 4.5 via GitLab, Google Antigravity, and GitHub Copilot) want to spread load across providers. When one gets hot, they switch to another — but only if the switch actually sticks. **Experimentation.** Sometimes you want to try a different model on a task that's already in progress, within the same agent's behavioral constraints. --- ## Current workaround Define an agent with **no `"model"` field** (e.g., `"free": { "mode": "primary", "steps": 400, ... }`). In this case, Ctrl+M selection does persist because there's no default to revert to. But this loses all the agent-specific config — you're starting from a blank slate. --- ## Relationship to #7602 [#7602](https://github.com/anomalyco/opencode/issues/7602) requests **automatic** model fallback on errors/rate limits. This issue is about **manual, user-initiated** model selection that persists across turns. They're complementary — #7602 handles the automatic case, this handles the intentional case. --- ## Proposed behavior - **Ctrl+M override is session-scoped**: once set, it overrides the agent's default model for the remainder of the session. - **Agent config preserved**: permissions, steps, options, temperature all remain from the agent definition. Only the model changes. - **Reset on agent switch or new session**: changing agents or starting a new session reverts to the agent's configured default. - **Visual indicator**: show the overridden model name in the status bar so the user knows they're not on the agent default. - **Optional**: a keybind or command to clear the override and revert to the agent default without switching agents.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 8, 2026):

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

  • #7602: Native Model Fallback / Failover Support (automatic model fallback on errors/rate limits - related but focuses on automatic behavior)
  • #9575: Model fallback in specific agents (similar automatic fallback concept)
  • #10725: Automatic model switch upon rate limitation (automatic behavior on rate limits)
  • #11008: Global image describing model as fallback and override (specific case for image models)

However, this issue is distinct in that it requests manual, user-initiated model selection that persists across turns, whereas the above issues primarily focus on automatic fallback mechanisms. Feel free to ignore if you believe this is a separate use case.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue might be a duplicate of existing issues. Please check: - #7602: Native Model Fallback / Failover Support (automatic model fallback on errors/rate limits - related but focuses on automatic behavior) - #9575: Model fallback in specific agents (similar automatic fallback concept) - #10725: Automatic model switch upon rate limitation (automatic behavior on rate limits) - #11008: Global image describing model as fallback and override (specific case for image models) However, this issue is distinct in that it requests **manual, user-initiated model selection that persists across turns**, whereas the above issues primarily focus on **automatic** fallback mechanisms. Feel free to ignore if you believe this is a separate use case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8818