From 4c72c5f671e672cbd0aa80908c0cf994a1993fd0 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 29 Mar 2026 19:28:59 -0700 Subject: [PATCH] Stop resetting send phase from server snapshot - Keep the optimistic send phase stable during turn start - Remove redundant snapshot syncs that caused phase flicker --- apps/web/src/components/ChatView.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 1faa19c575..0a471c8bfd 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -2821,15 +2821,6 @@ export default function ChatView({ threadId }: ChatViewProps) { createdAt: messageCreatedAt, }); turnStartSucceeded = true; - - // Sync snapshot before the transition ends so that `phase` reflects - // the new session state ("connecting"/"running"). Without this the - // optimistic overlay reverts to the stale `phase` (often - // "disconnected" for first-turn threads), causing a brief flicker. - await api.orchestration - .getSnapshot() - .then((snapshot) => syncServerReadModel(snapshot)) - .catch(() => undefined); } catch (err: unknown) { if (createdServerThreadForLocalDraft && !turnStartSucceeded) { await api.orchestration @@ -3121,13 +3112,6 @@ export default function ChatView({ threadId }: ChatViewProps) { planSidebarDismissedForTurnRef.current = null; setPlanSidebarOpen(true); } - - // Sync snapshot before the transition ends so that `phase` reflects - // the session state, preventing a brief flicker. - await api.orchestration - .getSnapshot() - .then((snapshot) => syncServerReadModel(snapshot)) - .catch(() => undefined); } catch (err) { setOptimisticUserMessages((existing) => existing.filter((message) => message.id !== messageIdForSend), @@ -3161,7 +3145,6 @@ export default function ChatView({ threadId }: ChatViewProps) { startSendTransition, setOptimisticPhase, startOptimisticSendPhase, - syncServerReadModel, selectedModel, ], );