Before submitting#
Area#
apps/server
Steps to reproduce#
- Use a Claude thread that is working (a run is
running).
- From a client, send several messages quickly with
orchestration.dispatchCommand / message.dispatch, deliveryIntent: "auto" (no explicit target run). Example: tapping a quick-reply button about ten times while the agent works.
- About one in a dozen messages lands just as the run's provider turn ends, or before the next one starts.
Expected behavior#
deliveryIntent: "auto" never fails because of timing. If the active run has no running provider turn at that moment, the message is queued behind it or starts a new run.
Actual behavior#
The command is refused with OrchestrationV2DispatchCommandError: No running provider turn found for active run run:thread:<id>:ordinal:<n>. The message isn't delivered. Retrying the same commandId is refused too, since a rejected command id stays rejected.
Reading the bundle: resolveMessageDispatchIntent (CommandPolicy) picks steer_active when the latest run is running/waiting and the session supports active steering. The later check in the dispatcher falls back to start_immediately only when the provider turn exists and is completed. When no provider turn is running for the run's active attempt (the gap between turns), the steering path throws instead.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261003.2632
Environment#
Linux server (self-hosted), claudeAgent / claude-opus-5-5, messages sent by an outside client over the WebSocket API (orchestration protocol 2).
Workaround#
The client retries the message a few seconds later as a new command id.
Note
Grok responding on behalf of Julius.
Triage#
Thanks so much for tracking this down through the bundle, @CoreInfusion. I could confirm it on current
main. A message sent withdeliveryIntent: "auto"can be rejected when it arrives while a run is stillrunningorwaitingbut none of its provider turns is inrunning. I didn't find an existing issue for this race.What I found#
resolveMessageDispatchIntent(apps/server/src/orchestration-v2/CommandPolicy.ts) turnsautointosteer_activewhenever the latest run isrunningorwaitingand the session supports active steering, which Claude does. It doesn't look at provider-turn status.preparingandstartingalready queue.apps/server/src/orchestration-v2/Orchestrator.tsonly backs off tostart_immediately(which queues behind the active run) when the run iscompleted, or when the root node's provider turn for the active attempt iscompleted. Everything else stays on the steer path.dispatchSteerIntoRunthen requires a provider turn withstatus === "running"foractiveAttemptId, and throwsNo running provider turn found for active run …when there isn't one. The WebSocket layer returns that asOrchestrationV2DispatchCommandError.ProviderTurnStartService: the run, attempt, and root node are committed asrunningbeforesession.startTurnemits the running provider turn, and handoff delivery sits in that window. The same throw also covers other turn states the late check doesn't consider (pending,interrupted,failed,cancelled, or a new attempt whose turn row isn't written yet).commandIdreturns the earlier rejection. Retrying with a new command id, as in your workaround, is what works today.deliveryIntent: "auto"path when the server resolves delivery, so this probably isn't limited to external clients.Likely fix area#
autofall back to queueing (orstart_immediately) whenever the active attempt has no running provider turn, either inresolveMessageDispatchIntentor in the late check inOrchestrator.ts.steercould keep requiring a running provider turn, so onlyautochanges behavior.ProviderTurnStartServicewindow specifically could also be part of it.A maintainer will decide on the fix direction.