mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 11:10:20 +00:00
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:
committed by
Peter Steinberger
parent
abb0252a1a
commit
5868344ade
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user