Skip to content

Commit 579ea42

Browse files
committed
fix(mobile): setup detection also reads the thread runtime before detail loads
1 parent badb634 commit 579ea42

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,11 @@ export function useThreadComposerState() {
679679
});
680680
// A send while the worktree is still being set up waits behind that setup,
681681
// so the server can hold it if the setup ends without a worktree.
682-
const setupRunning =
683-
selectedThreadActivityRun?.status === "preparing" ||
684-
selectedThreadActivityRun?.status === "starting";
682+
// Before detail loads, the shell's latest run can be a queued follow-up
683+
// while its runtime still reports the setup.
684+
const setupRunning = [selectedThreadActivityRun?.status, selectedThreadRuntime?.status].some(
685+
(status) => status === "preparing" || status === "starting",
686+
);
685687
const followUpDispatchMode = setupRunning
686688
? "queue"
687689
: followUpAction === "auto"
@@ -747,6 +749,7 @@ export function useThreadComposerState() {
747749
selectedEnvironmentRuntime?.serverConfig,
748750
selectedThreadActivityRun?.status,
749751
selectedThreadCreation,
752+
selectedThreadRuntime?.status,
750753
selectedThreadShell,
751754
uploadThreadFeedback,
752755
],

0 commit comments

Comments
 (0)