fix(server,mobile): a message you send resumes a held queue, and mobile can resume one #21473
Mergedjuliusmarmingemerged 4 commits into
main fromt3code/queue-hold-releasemerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/orchestration-v2/Orchestrator.ts lines 5017 to 5017OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -5002,5 +5002,16 @@5002- const shouldQueue =5003- queueBehindRun !== undefined &&5004- (dispatchMode.type === "defer_start" ||5005- dispatchMode.type === "start_immediately" ||5006- dispatchMode.type === "queue_after_active");5002+ const startsOrQueuesRun =5003+ dispatchMode.type === "defer_start" ||5004+ dispatchMode.type === "start_immediately" ||5005+ dispatchMode.type === "queue_after_active";5006+ const shouldQueue = queueBehindRun !== undefined && startsOrQueuesRun;5007+ // A message the user sends from a client means they are back, so what a5008+ // stop or a restart held follows it rather than waiting for a Resume.5009+ // Continuations the server sends for them (after a usage limit or a5010+ // restart) are not them coming back. Starting the queue still re-holds5011+ // it for a failed provider or a usage limit; a missing worktree keeps its5012+ // hold, since its messages would start in the project checkout.5013+ const sentByUserFromClient =5014+ command.createdBy === "user" &&5015+ (command.creationSource === "web" || command.creationSource === "mobile");5016+ const heldRunsToRelease =5017+ sentByUserFromClient && startsOrQueuesRun && worktreeMissingRun === undefined
- apps/server/src/orchestration-v2/Orchestrator.ts lines 5026 to 5028Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -5003,4 +5002,17 @@5003- queueBehindRun !== undefined &&5004- (dispatchMode.type === "defer_start" ||5005- dispatchMode.type === "start_immediately" ||5006- dispatchMode.type === "queue_after_active");5002+ const startsOrQueuesRun =5003+ dispatchMode.type === "defer_start" ||5004+ dispatchMode.type === "start_immediately" ||5005+ dispatchMode.type === "queue_after_active";5006+ const shouldQueue = queueBehindRun !== undefined && startsOrQueuesRun;5007+ // A message the user sends from a client means they are back, so what a5008+ // stop or a restart held follows it rather than waiting for a Resume.5009+ // Continuations the server sends for them (after a usage limit or a5010+ // restart) are not them coming back. Starting the queue still re-holds5011+ // it for a failed provider or a usage limit; a missing worktree keeps its5012+ // hold, since its messages would start in the project checkout.5013+ const sentByUserFromClient =5014+ command.createdBy === "user" &&5015+ (command.creationSource === "web" || command.creationSource === "mobile");5016+ const heldRunsToRelease =5017+ sentByUserFromClient && startsOrQueuesRun && worktreeMissingRun === undefined5018+ ? projection.runs.filter((run) => run.status === "queued" && run.queueHeld === true)apps/server/src/orchestration-v2/Orchestrator.ts lines 5017 to 5018OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -5003,4 +5002,17 @@5003- queueBehindRun !== undefined &&5004- (dispatchMode.type === "defer_start" ||5005- dispatchMode.type === "start_immediately" ||5006- dispatchMode.type === "queue_after_active");5002+ const startsOrQueuesRun =5003+ dispatchMode.type === "defer_start" ||5004+ dispatchMode.type === "start_immediately" ||5005+ dispatchMode.type === "queue_after_active";5006+ const shouldQueue = queueBehindRun !== undefined && startsOrQueuesRun;5007+ // A message the user sends from a client means they are back, so what a5008+ // stop or a restart held follows it rather than waiting for a Resume.5009+ // Continuations the server sends for them (after a usage limit or a5010+ // restart) are not them coming back. Starting the queue still re-holds5011+ // it for a failed provider or a usage limit; a missing worktree keeps its5012+ // hold, since its messages would start in the project checkout.5013+ const sentByUserFromClient =5014+ command.createdBy === "user" &&5015+ (command.creationSource === "web" || command.creationSource === "mobile");5016+ const heldRunsToRelease =5017+ sentByUserFromClient && startsOrQueuesRun && worktreeMissingRun === undefined5018+ ? projection.runs.filter((run) => run.status === "queued" && run.queueHeld === true)@@ -206,6 +206,5 @@206206 the text. Drag a row by its handle to reorder it, use the handle's arrow keys, promote the message207207 to a steer, or remove it.208208209-If the server restarts, saved queued messages keep their order and are held. Press210-**Resume** in an empty composer on web or desktop, or **Resume queue** in the queue211-sheet on mobile, to continue. You can edit, reorder, or remove held messages without starting them.209+If you stop the agent or the server restarts, queued messages keep their order and are held,210+along with results from subagents that finish meanwhile. Press **Resume** in an empty composer to
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/orchestration-v2/Orchestrator.ts line 4992OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -4989,6 +4989,4 @@49894989 // without a worktree. It waits, held, like the messages queued before the49904990 // failure, instead of starting in the project checkout.49914991 const latestRun = latestExecutedRun(projection.runs);4992- const worktreeMissingRun =4993- activeRun === undefined &&4994- dispatchMode.type === "queue_after_active" &&4992+ const worktreeSetupFailed =docs/user/composer.md line 210OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -206,6 +206,5 @@206206 the text. Drag a row by its handle to reorder it, use the handle's arrow keys, promote the message207207 to a steer, or remove it.208208209-If the server restarts, saved queued messages keep their order and are held. Press210-**Resume** in an empty composer on web or desktop, or **Resume queue** in the queue211-sheet on mobile, to continue. You can edit, reorder, or remove held messages without starting them.209+If you stop the agent or the server restarts, queued messages keep their order and are held.210+Press **Resume** in an empty composer to continue. Sending a new message also resumes the queue,
juliusmarminge merged this62d9809
juliusmarminge closed this
juliusmarminge changed the title
juliusmarminge changed the title
Sign in to join this conversation.

macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed