Repository navigation
Description
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
- Thread B runs one long turn on a provider with active steering (Claude), for example a 10-minute foreground command.
- An agent in thread A queues a message to B:
t3_thread_send {"threadId": "<B>", "mode": "queue", "message": "first"}. It becomes a queued run created by an agent.
The same happens when the agent in A sends B a slash command withmode: "auto"(for example/context): since fix(server): slash commands sent during a turn wait instead of steering #40316 it is queued behind the active run. - An agent in a different thread C sends B a plain message:
t3_thread_send {"threadId": "<B>", "mode": "auto", "message": "urgent"}.
Expected behavior
C's auto send steers into B's running turn, as it does when nothing is queued. The ordering guard from #39417 only needs to keep one sender's messages in order, so a queued message from A should not hold back a message from C. (A's own later auto sends waiting behind A's queued message would keep #39404 fixed.)
Actual behavior
C's send returns delivery: "queued", and so does every later auto send from any agent, until B's turn ends. With a turn that runs for hours, those messages wait for hours.
The guard in Orchestrator.dispatchMessage turns an agent's auto steer into queue_after_active whenever the thread holds any non-held queued run whose message an agent created, without looking at who sent it:
t3code/apps/server/src/orchestration-v2/Orchestrator.ts
Lines 7574 to 7594 in 5e12857
| // An agent's automatic send must not overtake an earlier agent message still queued | |
| // (e.g. behind /compact), or the agent receives them out of send order. | |
| if ( | |
| command.deliveryIntent === "auto" && | |
| command.createdBy === "agent" && | |
| (dispatchMode.type === "steer_active" || dispatchMode.type === "restart_active") | |
| ) { | |
| const queuedRuns = projection.runs.filter( | |
| (run) => run.status === "queued" && run.queueHeld !== true, | |
| ); | |
| if (queuedRuns.length > 0) { | |
| const queuedMessages = yield* projectionStore | |
| .getMessagesById( | |
| command.threadId, | |
| queuedRuns.map((run) => run.userMessageId), | |
| ) | |
| .pipe(mapDispatchError(command)); | |
| if ([...queuedMessages.values()].some((message) => message.createdBy === "agent")) { | |
| dispatchMode = { type: "queue_after_active" }; | |
| } | |
| } |
A slash command an agent sends is always queued here, so it is one way to start the chain:
t3code/apps/server/src/orchestration-v2/CommandPolicy.ts
Lines 117 to 120 in 5e12857
| // A provider runs a steered command in place of the turn's task, so commands wait. | |
| return mode.type === "steer_active" && isSlashCommand(message) | |
| ? { type: "queue_after_active" } | |
| : mode; |
Messages already carry senderThreadId, so the check could compare the queued messages' senderThreadId with the incoming command's.
Impact
Major degradation or frequent failure
Version or commit
Seen on 0.1.12 nightly builds since 2026-11-22 (last on 0.1.12-nightly.20261123.5138). The same code is on main 5e12857.
Environment
Linux, desktop app with its local server, provider claudeAgent (claude-opus-5-5).
Logs or stack traces
One thread ran a single turn for about 5.5 hours.
- Before any queued message: auto sends from other threads came back "steered".
- One agent then sent that thread one message with mode "queue" (queued run 2).
- From then on, about 40 auto sends from five other agent threads all came back "queued".
Nothing reached the running turn for about 1.5 hours.
- When the turn ended, the queued runs started one after another.
- Explicit mode "steer" sends in the same window came back "steered" and were delivered.Workaround
Senders pass mode: "steer" to a thread that has a running turn, and fall back to auto when steer is refused because no turn is running.
Activity