The best way to control Claude Code, Codex and more from any computer or phone
fix(client): hide Resume while a pending request blocks continuing the run (#28810)
Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Victor committed
Nov 12, 2026 at 16:06 UTC
5f4368165b27a499a61fe5a919eb4680dd72f04a
7 files changed
+90
-5
apps/mobile/src/features/threads/ThreadRouteScreen.tsx
+1
-3
@@ -1071,9 +1071,7 @@ function ThreadRouteContent(
1071
onRemoveDraftImage={composer.onRemoveDraftImage}
1072
serverConfig={serverConfig}
1073
onStopThread={awaitingBootstrapTurn ? handleCancelWorktreeSetup : handleStopThread}
1074
- onResumeQueue={
1075
- composer.queueHeld || composer.resumableRunId !== null ? handleResumeQueue : null
1076
- }
1074
+ onResumeQueue={composer.canResume ? handleResumeQueue : null}
1075
onSendMessage={composer.onSendMessage}
1076
offersSideChat={composer.sideChatUnavailableReason === null}
1077
onReconnectEnvironment={handleReconnectEnvironment}
apps/mobile/src/state/use-thread-composer-state.ts
+5
@@ -13,6 +13,7 @@ import {
13
isDetailBehindShell,
14
} from "@t3tools/client-runtime/state/thread-activity-announcement";
15
import {
16
+ canResumeThread,
17
deriveProviderSubagentStatus,
18
deriveProviderExtensionStatuses,
19
deriveResumableRunId,
@@ -401,6 +402,9 @@ export function useThreadComposerState(input: {
402
const resumableRunId = selectedThreadProjection
403
? deriveResumableRunId(selectedThreadProjection.projection, selectedThreadRuntime)
404
: null;
405
+ const canResume = selectedThreadProjection
406
+ ? canResumeThread(selectedThreadProjection.projection, resumableRunId, queueHeld)
407
+ : queueHeld;
408
409
const runlessWorkStartedAt = selectedThreadProjection
410
? deriveRunlessWorkStartedAt(selectedThreadProjection.projection)
@@ -919,6 +923,7 @@ export function useThreadComposerState(input: {
923
canSteerActiveTurn,
924
queueHeld,
925
resumableRunId,
926
+ canResume,
927
queuedRunEdit,
928
isSavingQueuedEdit,
929
cancelQueuedRunEdit,
apps/web/src/components/ChatView.tsx
+6
-1
@@ -78,6 +78,7 @@ import {
78
RuntimeMode,
79
} from "@t3tools/contracts";
80
import {
81
+ canResumeThread,
82
deriveProviderSubagentStatus,
83
deriveProviderExtensionStatuses,
84
deriveReportedModelSelection,
@@ -840,6 +841,9 @@ export default function ChatView(props: ChatViewProps) {
841
!isServerThread || serverProjection === null
842
? null
843
: deriveResumableRunId(serverProjection, serverRuntime);
844
+ const canResume =
845
+ serverProjection !== null &&
846
+ canResumeThread(serverProjection, resumableRunId, hasHeldQueuedRuns);
847
const parentSubagentThreadId =
848
activeThread?.lineage.relationshipToParent === "subagent"
849
? activeThread.lineage.parentThreadId
@@ -2882,6 +2886,7 @@ export default function ChatView(props: ChatViewProps) {
2886
activeThread,
2887
resumableRunId,
2888
hasHeldQueuedRuns,
2889
+ canResume,
2890
isSendBusy,
2891
isRevertingCheckpoint,
2892
threadDetailLoading,
@@ -3626,7 +3631,7 @@ export default function ChatView(props: ChatViewProps) {
3631
queuedRunEdit.isSaving ||
3632
isResuming
3633
}
3629
- canResume={resumableRunId !== null || hasHeldQueuedRuns}
3634
+ canResume={canResume}
3635
isRevertingCheckpoint={isRevertingCheckpoint}
3636
sendDisabledReason={
3637
!canOperateThread
apps/web/src/components/chat/useComposerResume.browser.test.tsx
+1
@@ -52,6 +52,7 @@ function ResumeButton(props: {
52
activeThread: { id: threadA } as never,
53
resumableRunId: RunId.make("run:interrupted"),
54
hasHeldQueuedRuns: false,
55
+ canResume: true,
56
isSendBusy: false,
57
isRevertingCheckpoint: false,
58
threadDetailLoading: false,
apps/web/src/components/chat/useComposerResume.ts
+3
-1
@@ -28,6 +28,7 @@ interface ComposerResumeInput {
28
readonly activeThread: EnvironmentThreadShell | undefined;
29
readonly resumableRunId: RunId | null;
30
readonly hasHeldQueuedRuns: boolean;
31
+ readonly canResume: boolean;
32
readonly isSendBusy: boolean;
33
readonly isRevertingCheckpoint: boolean;
34
readonly threadDetailLoading: boolean;
@@ -59,6 +60,7 @@ export function useComposerResume(input: ComposerResumeInput) {
60
activeThread,
61
resumableRunId,
62
hasHeldQueuedRuns,
63
+ canResume,
64
isSendBusy,
65
isRevertingCheckpoint,
66
threadDetailLoading,
@@ -86,7 +88,7 @@ export function useComposerResume(input: ComposerResumeInput) {
88
const onResume = async () => {
89
if (
90
!activeThread ||
89
- (resumableRunId === null && !hasHeldQueuedRuns) ||
91
+ !canResume ||
92
isSendBusy ||
93
isResuming ||
94
isRevertingCheckpoint ||
packages/client-runtime/src/state/threadExecution.test.ts
+61
@@ -9,9 +9,11 @@ import {
9
ProviderTurnId,
10
RunAttemptId,
11
RunId,
12
+ RuntimeRequestId,
13
ThreadId,
14
type OrchestrationV2ExecutionNode,
15
type OrchestrationV2RunStatus,
16
+ type OrchestrationV2RuntimeRequest,
17
} from "@t3tools/contracts";
18
import * as DateTime from "effect/DateTime";
19
import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";
@@ -20,6 +22,7 @@ import { describe, expect, it } from "vite-plus/test";
22
23
import { v2Projection } from "./orchestrationV2TestFixtures.ts";
24
import {
25
+ canResumeThread,
26
deriveReportedModelSelection,
27
deriveLatestThreadRun,
28
deriveProviderSubagentStatus,
@@ -38,6 +41,23 @@ import {
41
42
const now = DateTime.makeUnsafe("2026-07-28T10:00:00.000Z");
43
44
+function request(
45
+ id: string,
46
+ status: OrchestrationV2RuntimeRequest["status"],
47
+): OrchestrationV2RuntimeRequest {
48
+ return {
49
+ id: RuntimeRequestId.make(id),
50
+ nodeId: NodeId.make(`node-${id}`),
51
+ providerTurnId: null,
52
+ nativeRequestRef: null,
53
+ kind: "command",
54
+ status,
55
+ responseCapability: { type: "not_resumable", reason: "Session ended." },
56
+ createdAt: now,
57
+ resolvedAt: status === "pending" ? null : now,
58
+ };
59
+}
60
+
61
function run(id: string, ordinal: number, status: OrchestrationV2RunStatus) {
62
return {
63
id: RunId.make(id),
@@ -369,6 +389,47 @@ describe("thread execution presentation", () => {
389
expect(deriveThreadRuntime(onlyHeld)).toBeNull();
390
});
391
392
+ it.each([
393
+ { name: "no requests", requests: [], runId: "run-stopped", held: false, expected: true },
394
+ {
395
+ name: "a pending request",
396
+ requests: [request("approval", "pending")],
397
+ runId: "run-stopped",
398
+ held: false,
399
+ expected: false,
400
+ },
401
+ {
402
+ name: "only a resolved request",
403
+ requests: [request("approval", "resolved")],
404
+ runId: "run-stopped",
405
+ held: false,
406
+ expected: true,
407
+ },
408
+ {
409
+ name: "a held queue behind a blocked continuation",
410
+ requests: [request("approval", "pending")],
411
+ runId: "run-stopped",
412
+ held: true,
413
+ expected: false,
414
+ },
415
+ {
416
+ name: "a held queue with no run to continue",
417
+ requests: [request("approval", "pending")],
418
+ runId: null,
419
+ held: true,
420
+ expected: true,
421
+ },
422
+ { name: "nothing to resume", requests: [], runId: null, held: false, expected: false },
423
+ ])("decides whether Resume can start with $name", ({ requests, runId, held, expected }) => {
424
+ expect(
425
+ canResumeThread(
426
+ { runtimeRequests: requests },
427
+ runId === null ? null : RunId.make(runId),
428
+ held,
429
+ ),
430
+ ).toBe(expected);
431
+ });
432
+
433
it("does not expose a queued-only run as interruptible", () => {
434
const queuedRun = run("run-queued", 1, "queued");
435
const projection = { ...v2Projection, runs: [queuedRun], updatedAt: now };
packages/client-runtime/src/state/threadExecution.ts
+13
@@ -319,6 +319,19 @@ export function deriveResumableRunId(
319
: null;
320
}
321
322
+/**
323
+ * Whether Resume can start: the run's continuation, else the held queue. The server refuses that
324
+ * continuation while any request is pending, so the queue must not be released in its place.
325
+ */
326
+export function canResumeThread(
327
+ projection: Pick<ThreadStructure, "runtimeRequests">,
328
+ resumableRunId: RunId | null,
329
+ queueHeld: boolean,
330
+): boolean {
331
+ if (resumableRunId === null) return queueHeld;
332
+ return !projection.runtimeRequests.some((request) => request.status === "pending");
333
+}
334
+
335
export function deriveThreadRuntime(
336
projection: ThreadStructure & Pick<OrchestrationV2ThreadProjection, "updatedAt">,
337
): ThreadRuntimeSummary | null {