From 65fdeb6dac2384c8325ff69d5a77c207a7b0149a Mon Sep 17 00:00:00 2001 From: 7418 <7418@openclaw.ai> Date: Sun, 1 Mar 2026 00:49:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bridge=20=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E4=B8=8D=E7=AB=8B=E5=8D=B3=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9C=A8=20ChatList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bridge 在服务端通过 createSession() 创建会话,无法触发浏览器端的 session-created 事件,导致 ChatListPanel 不知道有新聊天。 添加 5 秒轮询刷新,查本地 SQLite 开销可忽略,bridge 新建的会话 最多 5 秒即可出现在聊天列表。 Co-Authored-By: Claude Opus 4.6 --- src/components/layout/ChatListPanel.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/layout/ChatListPanel.tsx b/src/components/layout/ChatListPanel.tsx index 31333a8..56eb186 100644 --- a/src/components/layout/ChatListPanel.tsx +++ b/src/components/layout/ChatListPanel.tsx @@ -259,6 +259,14 @@ export function ChatListPanel({ open, width }: ChatListPanelProps) { }; }, [debouncedFetchSessions]); + // Periodic poll to catch sessions created server-side (e.g. bridge) + useEffect(() => { + const interval = setInterval(() => { + fetchSessions(); + }, 5000); + return () => clearInterval(interval); + }, [fetchSessions]); + const handleDeleteSession = async ( e: React.MouseEvent, sessionId: string