From 17734a6c65c7c2903145d28743f51d8ba0272991 Mon Sep 17 00:00:00 2001 From: Jovines <1246634075@qq.com> Date: Fri, 27 Feb 2026 15:32:20 +0800 Subject: [PATCH] fix(notification): cache parentID from session events to fix subtask notification detection (#530) --- packages/web/server/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/web/server/index.js b/packages/web/server/index.js index 1cddce15..52df69f6 100644 --- a/packages/web/server/index.js +++ b/packages/web/server/index.js @@ -847,6 +847,11 @@ const maybeCacheSessionInfoFromEvent = (payload) => { const sessionId = info.id; const title = info.title; cacheSessionTitle(sessionId, title); + // Also cache parentID from session events to ensure subtask detection works correctly + const parentID = info.parentID; + if (sessionId && parentID !== undefined) { + setCachedSessionParentId(sessionId, parentID); + } }; /** @@ -4170,7 +4175,7 @@ const fetchSessionParentId = async (sessionId) => { } const match = data.find((s) => s && typeof s === 'object' && s.id === sessionId); - const parentID = match && typeof match.parentID === 'string' && match.parentID.length > 0 ? match.parentID : null; + const parentID = match?.parentID ? match.parentID : null; setCachedSessionParentId(sessionId, parentID); return parentID; } catch {