feat(mobile): port worktree setup progress and agent handoff #12177
Mergedjuliusmarmingemerged 1 commit into
mobile-worktree-setup/cancellation fromrefs/pull/12177/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/mobile/src/features/threads/ThreadRouteScreen.tsx line 1020Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -912,0 +1000,21 @@1000+ setupWorkingStartedAt={1001+ composer.activeWorkStartedAt !== null &&1002+ selectedThreadDetail?.activities.some(1003+ (activity) => activity.kind === "worktree-setup",1004+ ) &&1005+ composer.selectedThreadFeed.filter(1006+ (entry) => entry.type === "message" && entry.message.role === "user",1007+ ).length <= 11008+ ? composer.activeWorkStartedAt1009+ : null1010+ }1011+ worktreeSetup={1012+ worktreeSetup1013+ ? {1014+ snapshot: worktreeSetup,1015+ turnStartedAt: selectedThreadDetail?.latestTurn?.startedAt ?? null,1016+ working: composer.activeWorkStartedAt !== null,1017+ turnStarted: selectedThreadDetail?.latestTurn?.startedAt != null,1018+ onCancel: handleCancelWorktreeSetup,1019+ onWorkLocally:1020+ selectedThreadCreation?.outcome == null && selectedThreadCreationapps/mobile/src/features/threads/ThreadRouteScreen.tsx line 864Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -828,0 +844,21 @@844+ input: { threadId: selectedThread.id },845+ });846+ }, [cancelWorktreeSetup, selectedThread]);847+ const [localResendMessageId, setLocalResendMessageId] = useState<string | null>(null);848+ const handleWorkLocally = useCallback(async () => {849+ if (!selectedThread || !selectedThreadCreation) return;850+ const result = await cancelWorktreeSetup({851+ environmentId: selectedThread.environmentId,852+ input: { threadId: selectedThread.id },853+ });854+ if (result._tag === "Success" && result.value.cancelled) {855+ setLocalResendMessageId(selectedThreadCreation.message.messageId);856+ }857+ }, [cancelWorktreeSetup, selectedThread, selectedThreadCreation]);858+ // Wait for the outbox to restore the cancelled send before queuing its replacement.859+ useEffect(() => {860+ const pending = selectedThreadCreation;861+ if (862+ !localResendMessageId ||863+ pending?.message.messageId !== localResendMessageId ||864+ pending.outcome?.kind !== "failed"
juliusmarminge merged this4abb07e
juliusmarminge closed this
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result:
917c389· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.