Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a message promoted into a stopping run stays queued #16926

Mergedlbgos(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/16926/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 131 additions and 0 deletions.

x
0 of 2 viewed, 2 left
20 additions and 0 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -3958,6 +3958,15 @@
cause: `Target run ${targetRun.id} is ${targetRun.status} and cannot be steered.`,
+ // The run reads as running until its provider stops, but a steer accepted
+ // after Stop never reaches the agent.
+ if (yield* stopReachedRun(input.command, input.command.threadId, targetRun.id)) {
+ return yield* new OrchestratorDispatchError({
+ commandId: input.command.commandId,
+ commandType: input.command.type,
+ cause: `Target run ${targetRun.id} is stopping and cannot be steered.`,
+ });
+ }
const providerThread = input.projection.providerThreads.find(
(candidate) => candidate.id === targetRun.providerThreadId,
@@ -4804,6 +4813,17 @@
dispatchMode = { type: "start_immediately" };
+ // Stop leaves the run reading as running until its provider stops. A plain
+ // send in that window queues behind the stopped queue instead of steering
+ // text the agent never receives, and like any user send it releases the
+ // hold; an explicit steer or restart still fails below.
+ if (
+ command.deliveryIntent === "auto" &&
+ (dispatchMode.type === "steer_active" || dispatchMode.type === "restart_active") &&
+ (yield* stopReachedRun(command, command.threadId, dispatchMode.targetRunId))
+ ) {