Skip to content

Commit 8ec82fd

Browse files
revert(web,mobile): leave send handling to the server hold
The server already holds a fresh send after a stopped or failed worktree setup, for every client. The client-side queue switch also unblocked the composer behind a stale setup card, which is a visible change beyond the fix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c7c85aa commit 8ec82fd

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

‎apps/mobile/src/state/use-thread-composer-state.ts‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -774,16 +774,9 @@ export function useThreadComposerState(input: {
774774
alternateModifier: followUpOverride !== undefined && followUpOverride !== activeTurnDefault,
775775
activeTurnDefault,
776776
});
777-
// A stopped worktree setup still holds new sends on the server.
778-
const worktreePending = orchestrationV2WorktreePending(
779-
selectedThreadShell.worktreePath ?? null,
780-
selectedThreadProjection?.projection.runs ?? [],
777+
const setupRunning = [selectedThreadActivityRun?.status, selectedThreadRuntime?.status].some(
778+
(status) => status === "preparing" || status === "starting",
781779
);
782-
const setupRunning =
783-
worktreePending ||
784-
[selectedThreadActivityRun?.status, selectedThreadRuntime?.status].some(
785-
(status) => status === "preparing" || status === "starting",
786-
);
787780
const followUpDispatchMode = setupRunning
788781
? "queue"
789782
: followUpAction === "auto"

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,15 +1488,8 @@ export default function ChatView(props: ChatViewProps) {
14881488
deriveActiveWorkStartedAt(activeActivityRun, activeRuntime, localDispatchStartedAt) ??
14891489
runlessWorkStartedAt;
14901490
const activeRunPreparing = activeActivityRun?.status === "preparing";
1491-
// A stopped worktree setup still holds new sends, so they queue rather than flash as sent.
14921491
const sendQueuesBehindSetup =
1493-
isServerThread &&
1494-
(activeRunPreparing ||
1495-
activeActivityRun?.status === "starting" ||
1496-
orchestrationV2WorktreePending(
1497-
activeThread?.worktreePath ?? null,
1498-
serverProjection?.runs ?? [],
1499-
));
1492+
isServerThread && (activeRunPreparing || activeActivityRun?.status === "starting");
15001493
const [setupQueueSendThreadKey, setSetupQueueSendThreadKey] = useState<string | null>(null);
15011494
const downloadFileAttachment = async (attachment: ChatFileAttachment) => {
15021495
const connection = readPreparedConnection(environmentId);

0 commit comments

Comments
 (0)