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 <noreply@anthropic.com>
This commit is contained in:
scoootscooob
2026-03-02 15:03:40 -08:00
committed by Peter Steinberger
parent abb0252a1a
commit 5868344ade

View File

@@ -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;