diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index c8bb4f972..c33e8a060 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -1182,6 +1182,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF const autoContextRef = useRef(null); const pendingLaunchRef = useRef(null); const [launchAutoSendTick, setLaunchAutoSendTick] = useState(0); + const hasInitializedChatStateRef = useRef(false); const sessionMenuRef = useRef(null); const historyScrollTimerRef = useRef | null>(null); @@ -2681,6 +2682,11 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF const hasHydratedHistoryRef = useRef(false); useEffect(() => { + if (!hasInitializedChatStateRef.current) { + hasInitializedChatStateRef.current = true; + return; + } + loadedHistorySignatureRef.current = ""; processedMessageIds.current.clear(); hasHydratedHistoryRef.current = false;