Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(composer): queue follow-ups after limits, compaction, and background waits #32010

ClosedwSedlacek(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/32010/headopened View on GitHub

Showing 14 changed files with 88 additions and 8 deletions (loading 11).

x
0 of 14 viewed, 14 left
15 additions and 7 deletionsapps/mobile/src/state/use-thread-composer-state.tsModified
View file
@@ -40,6 +40,7 @@
import { resolveThreadWorkingStartedAt } from "@t3tools/client-runtime/state/models";
import { upgradeLegacyContextMessage } from "@t3tools/shared/composerContextLegacy";
import { restoreAttachmentOnlyBootstrapPrompt } from "@t3tools/shared/composerContextReferences";
+import { backgroundWorkHoldsCompletion } from "@t3tools/shared/orchestrationV2PendingBackgroundWork";
import { composerContextSendBlockReason, reidentifyComposerContext } from "../lib/composerContext";
import { uuidv4 } from "../lib/uuid";
​
@@ -369,7 +370,15 @@
run: selectedThreadProjection?.projection.runs.find((run) => run.id === activeRunId),
messages: selectedThreadMessages,
});
- const canSteerActiveTurn = queueWorkflow?.canPromoteToSteer === true && !compactionBlocksSteer;
+ // Awaited commands/subagents park runtime at idle while the banner still says
+ // Waiting; treat that like an active turn so follow-ups queue instead of starting.
+ const isWaitingOnBackgroundWork = backgroundWorkHoldsCompletion(
+ selectedThreadShell?.pendingBackgroundTasks ?? [],
+ );
+ const canSteerActiveTurn =
+ queueWorkflow?.canPromoteToSteer === true &&
+ !compactionBlocksSteer &&
+ !isWaitingOnBackgroundWork;
// A stop or a restart holds the queue, completion wakes included, until it
// is resumed; the queue sheet lists only the user's own messages.
const queueHeld = queueWorkflow?.isHeld === true;
@@ -397,7 +406,8 @@
? deriveProviderSubagentStatus(selectedThreadProjection.projection)
: null;