@devries-cameron20 / t3code Mirror · read-only / commits / 49b0cc3d3f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 18:30 UTC

fix(mobile): queue sheet's Resume queue continues a usage-limited thread (#35576)

Julius Marminge committed Nov 12, 2026 at 12:17 UTC 49b0cc3d3fb8c1b617a53012c888295b6c2ac0c6
1 file changed +21 -1
apps/mobile/src/features/threads/ThreadQueueControl.tsx
+21 -1
@@ -5,6 +5,10 @@ import {
5 queuedRunEditBlockedReason,
6 } from "@t3tools/client-runtime/queued-run-edit";
7 import { scopeThreadRef } from "@t3tools/client-runtime/environment";
8 +import {
9 + isAtomCommandInterrupted,
10 + squashAtomCommandFailure,
11 +} from "@t3tools/client-runtime/state/runtime";
12 import { resolveUserMessagePresentation } from "@t3tools/client-runtime/user-message";
13 import type { ChatAttachment, EnvironmentId, RunId, ThreadId } from "@t3tools/contracts";
14 import { Atom } from "effect/reactivity";
@@ -20,6 +24,7 @@ import { useUniwindTheme } from "../../lib/useUniwindTheme";
24 import { useSafeAreaInsets } from "react-native-safe-area-context";
25
26 import { Button } from "../../components/ui/Button";
27 +import * as Dialog from "../../components/ui/Dialog";
28 import { SheetHeader } from "../../components/ui/SheetHeader";
29 import { AppText as Text } from "../../components/ui/AppText";
30 import { SymbolView } from "../../components/ui/AppSymbol";
@@ -132,6 +137,10 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
137 const promote = useAtomCommand(threadEnvironment.promoteQueuedRun, "promote queued message");
138 const cancel = useAtomCommand(threadEnvironment.cancelQueuedRun, "remove queued message");
139 const resume = useAtomCommand(threadEnvironment.resumeThreadQueue, "resume queue");
140 + const resumeHeldQueue = useAtomCommand(threadEnvironment.resumeThreadQueue, {
141 + label: "resume queue",
142 + reportFailure: false,
143 + });
144 const [resuming, setResuming] = useState(false);
145 const [busyRunId, setBusyRunId] = useState<RunId | null>(null);
146 const busyRef = useRef(false);
@@ -217,9 +226,20 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
226 if (busyRef.current) return;
227 busyRef.current = true;
228 setResuming(true);
220 - await resume({ ...target, input: { threadId: target.threadId } });
229 + const result = await resumeHeldQueue({
230 + ...target,
231 + input: { threadId: target.threadId },
232 + });
233 busyRef.current = false;
234 setResuming(false);
235 + // A usage limit holds the queue until the composer's Resume thread continues the run.
236 + if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
237 + const error = squashAtomCommandFailure(result);
238 + Dialog.alert(
239 + "Could not resume queue",
240 + error instanceof Error ? error.message : "Try again.",
241 + );
242 + }
243 }}
244 />
245 </View>