From 5868344adefabe50787de0aa110ce51e611c5d02 Mon Sep 17 00:00:00 2001 From: scoootscooob Date: Mon, 2 Mar 2026 15:03:40 -0800 Subject: [PATCH] fix(reminder): do not suppress note when sessionKey is unavailable Address Greptile review: when sessionKey is undefined the fallback matched any enabled cron job, which could silently suppress the guard note due to jobs from unrelated sessions. Return false instead so the note always appears when session scoping is not possible. Co-Authored-By: Claude Opus 4.6 --- src/auto-reply/reply/agent-runner.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/auto-reply/reply/agent-runner.ts b/src/auto-reply/reply/agent-runner.ts index 0a49cf2214c..937262ea803 100644 --- a/src/auto-reply/reply/agent-runner.ts +++ b/src/auto-reply/reply/agent-runner.ts @@ -92,8 +92,10 @@ async function hasSessionRelatedCronJobs(params: { if (params.sessionKey) { return store.jobs.some((job) => job.enabled && job.sessionKey === params.sessionKey); } - // Fallback: any enabled cron job counts. - return store.jobs.some((job) => job.enabled); + // No session key available — cannot scope the check, so do not suppress + // the note. Broadening to all enabled jobs could silently swallow the + // guard note due to unrelated sessions. + return false; } catch { // If we cannot read the cron store, do not suppress the note. return false;