diff --git a/src/components/ChatPanel.tsx b/src/components/ChatPanel.tsx index 75fa9e4..db2eaa6 100644 --- a/src/components/ChatPanel.tsx +++ b/src/components/ChatPanel.tsx @@ -67,7 +67,9 @@ export default function ChatPanel({ chatId, projectId }: Props) { // WS: new messages useEffect(() => { const unsub = wsClient.on("message.new", (msg: Message) => { - if (msg.chat_id !== chatId) return; + // Accept messages for this chat OR task messages from same project + if (msg.chat_id !== chatId && !msg.task_id) return; + if (msg.chat_id && msg.chat_id !== chatId) return; setMessages((prev) => { if (prev.some((m) => m.id === msg.id)) return prev; return [...prev, msg];