Skip to content

[Bug]: A queued message that names no model reverts a model change made while it waited #40365

Closed

Description

@baohappy02

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Start a long turn on a thread (model A, or effort high).
  2. While it runs, send the thread a message that carries no model selection, so it queues. Example: t3_thread_send from another thread, or any server/agent message.
  3. While it waits, change the thread's model or effort with t3_thread_configure (or the picker), e.g. to effort low. The change succeeds and reads back.
  4. Either let the running turn end so the queued message starts, or click Steer on the queued row.

Expected behavior

The queued message runs on the thread's current selection (effort low), and the thread stays on it. A message that named no model has no pick of its own to keep. In #19376 the maintainers noted that t3_thread_send "passes no selection, so it already follows the thread".

Actual behavior

The queued message runs on the selection the thread had when it was queued (effort high). The server then writes that selection back onto the thread (thread.model-selection-updated, no command), so the change from step 3 is silently undone for every later turn. Several such messages queued across a change make the thread flip back and forth. See the 2026-11-09 comment on #19376.

Cause, on main 755de001f2:

  • At dispatch, a queued message without modelSelection gets a copy of the queue-tail or thread selection, taken at queue time: Orchestrator.ts#L7885-L7895, queueTailModelSelection.
  • Only scheduled-task messages are marked followsThreadSelection: #L8151-L8153. Other no-model messages keep that stored copy.
  • queuedRunModelSelection returns the stored copy unless the message follows the thread: #L1052-L1061. thread.model-selection.set does not update queued runs.
  • When the run starts, a stored copy that differs from the thread is written back as thread.model-selection-updated: #L2532, #L3193-L3210.
  • Promote-to-Steer does the same through dispatchSteerIntoRun with the stored copy (#L11814, #L6550-L6570). The command itself carries no selection (orchestrationV2.ts#L3619-L3624).

A possible fix: mark a message that arrives without modelSelection as followsThreadSelection, like scheduled tasks (#34149). It then resolves its selection when it starts or is promoted. That still meets #33591's goal: by the time it starts, a picked run ahead of it has already moved the thread to its model.

Impact

Major degradation or frequent failure

Version or commit

v0.1.12-nightly.20261121.5038; same code on main 755de00

Environment

macOS desktop app, Claude provider. The orchestration code is provider-independent.

Workaround

Set the model again after the queue drains.

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

Metadata

Metadata

Assignees

No one assigned

    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