Skip to content

Model randomly switches between concurrent sessions in the same project #52805

Closed as not planned

Description

@unitdev117

Description

Description

When working in the same project with multiple sessions open, the model assigned to one or more sessions can unexpectedly change during an ongoing conversation.

For example:

Session A is using DeepSeek V4.1

Session B is using a Codex model through a subscription

Both sessions initially work with their individually selected models as expected. However, while continuing to use them, one of the sessions may suddenly switch to a different model without any manual model change.

The behavior does not appear to consistently affect only one session or one provider. It can happen to either session, and the model it switches to is not always the same.

Where it happens

I have reproduced this in both:

OpenCode CLI

OpenCode Desktop

I am currently using the v2 version.

Expected behavior

Each session should retain its own selected model independently.

If Session A is configured to use DeepSeek V4.1 and Session B is configured to use Codex, those model selections should remain unchanged unless I explicitly change them.

Actual behavior

During an active conversation, the selected model for a session can randomly change even though I have not changed the model manually.

This becomes particularly noticeable when multiple sessions belonging to the same project are active with different models.

Reproduction scenario

Open the same project.

Create/open two separate sessions.

Select a different model for each session.

Continue chatting in both sessions.

After some usage, observe that the model assigned to one of the sessions may unexpectedly change.

The issue seems intermittent, so it may not happen immediately on every attempt.

Additional notes

Since the same behavior occurs in both the CLI and Desktop application, it may be related to how session/model state is being stored or synchronized rather than being specific to either UI.

Plugins

None

OpenCode version

Desktop (2.0.22) & CLI (2.0.20)

Steps to reproduce

  1. Just

Screenshot and/or share link

Image

Operating System

Windows

Terminal

Windows Terminal , Alacritty

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

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

    • #2131: reports model selection flip-flopping between two side-by-side sessions.
  2. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report. I tried to reproduce this on 2.0.20 (on Linux, with a simulated provider that has two models) and couldn't. I tried three setups:

    • Two TUI windows on the same project, each with its own session on a different model, chatting in each one in turn.
    • The same, but picking the model explicitly with /models in both sessions.
    • One TUI with two session tabs on different models, switching tabs and sending a prompt after each switch.

    In every case each session kept its own model, both in the composer and on the replies.

    The providers may be the missing piece: you're using a ChatGPT/Codex subscription and DeepSeek, which I couldn't test without real accounts. Several changes in this area have landed since 2.0.20/2.0.22, for example keeping a session's saved model when it is temporarily missing from the model list (#53822) and when the model list refreshes (#54481).

    These details would help:

    1. Does it still happen on the latest release?
    2. When it switches, which model does the session switch to? Is it your default model, the model used most recently in the other session, or something else?
    3. Does only the label in the composer change, or is the next reply actually generated by the other model? The model name under each reply shows which one answered.
    4. Does it happen right after something specific, such as switching tabs, reopening a session, the app regaining focus, or after a long idle time?
    5. Your config's model setting, and whether the sessions use different agents.

    Related: #2131 is an older report of the same symptom, but it was against v1, which is a separate codebase.

  3. opencodejr commented on Oct 30, 2026

    @opencodejr
    Contributor

    I'm closing this issue for now because we couldn't reproduce it and haven't heard back. On 2.0.20, with two sessions on different models in the same project, each session kept its own model. I tested two TUI windows and two tabs in one TUI.

    If it still happens on the latest release, please reply here or open a new issue and link this one. These details would help us look into it again:

    • which model the session switches to
    • whether the next reply is actually generated by that model or only the label changes
    • what you were doing just before it switched, e.g. switching tabs, reopening a session, or coming back after idle time

    Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions