b548ed4f193053772418e1606587c428cce69676
When ensureThread() creates a new thread and calls setCurrentThreadId, the useEffect fires thread.switchThread() again after doSubmit already called it — wiping thread.messages mid-stream and showing the welcome screen instead of AI replies. Fix: add skipNextSwitchRef. When doSubmit creates a new thread and manually calls thread.switchThread(), it sets the flag so the subsequent useEffect is a no-op. Only needed for new threads (when currentThreadId was null); existing-thread submits don't change currentThreadId so the useEffect never fires. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Description
No description provided
17 MiB
Languages
TypeScript
98%
CSS
1.1%
JavaScript
0.6%
Dockerfile
0.1%