fix(ui): P0 线程切换时调用 switchThread 彻底清除 error 状态
Deploy LangGraph UI to Azure Static Web Apps / build-and-deploy (push) Failing after 38s
Trigger auto deployment for soc-langgraph / build-and-deploy (push) Failing after 45s

useStream 的 error 跨线程持久化,切换 threadId 时不自动重置。
useEffect 监听 currentThreadId 变化,调用 thread.switchThread()
清除 error、messages 等所有旧状态,从根本上解决切换线程后
红色错误横幅残留问题。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gongzhiyong
2026-04-15 01:18:16 +08:00
co-authored by Claude Sonnet 4.6
parent dc7d443b19
commit 0908e983fb
+5
View File
@@ -95,6 +95,11 @@ function App() {
return () => window.removeEventListener("open-canvas", handler);
}, []);
// Clear error and stale stream state when thread switches
useEffect(() => {
thread.switchThread(currentThreadId);
}, [currentThreadId]); // eslint-disable-line react-hooks/exhaustive-deps
// Sync concurrent status with thread loading state
useEffect(() => {
if (!thread.isLoading && concurrentStatus !== "cancelling") {