fix(ui): P0 线程切换时调用 switchThread 彻底清除 error 状态
useStream 的 error 跨线程持久化,切换 threadId 时不自动重置。 useEffect 监听 currentThreadId 变化,调用 thread.switchThread() 清除 error、messages 等所有旧状态,从根本上解决切换线程后 红色错误横幅残留问题。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
dc7d443b19
commit
0908e983fb
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user