fix: filter channel team task events from web UI chat

Admin users were seeing team task notifications from other channels
(Discord, Telegram, Lark) in their web UI chat due to bypassing the
UserID event filter. Added channel check to handleTeamTaskEvent matching
the existing pattern in handleAgentEvent.
This commit is contained in:
viettranx committed 2026-03-29 22:37:01 +07:00
1 parent 21b6c454ca
commit 63ed4e9351
1 file changed
+7
@@ -437,9 +437,16 @@ export function useChatMessages(sessionKey: string, agentId: string) {
progress_percent?: number;
progress_step?: string;
reason?: string;
channel?: string;
};
if (!event?.team_id) return;
// Only process team task events from WS channel (matches handleAgentEvent filter).
// Prevents channel events (Telegram, Discord, etc.) leaking into web UI chat.
if (event.channel && event.channel !== "ws") {
return;
}
setTeamTasks((prev) => {
const existing = prev.find((t) => t.taskId === event.task_id);