feat: add ignorePatterns to filter cron/subagent noise (v3.1)

This commit is contained in:
2026-03-31 14:25:19 +10:00
parent cc0aad38cb
commit 8db3154cff
2 changed files with 22 additions and 0 deletions
+13
View File
@@ -353,6 +353,19 @@ const plugin = {
return cleaned.length > 10;
});
// Check ignore patterns — skip sessions matching cron/subagent noise
const ignorePatterns = (config.ignorePatterns || [])
.map(p => { try { return new RegExp(p, "i"); } catch { return null; } })
.filter(Boolean);
if (ignorePatterns.length > 0 && realUserMsgs.length > 0) {
const firstMsg = realUserMsgs[0];
if (ignorePatterns.some(re => re.test(firstMsg))) {
log.info?.("[memory-continuity] Session matches ignorePattern, skipping");
return;
}
}
const existing = readFile(statePath);
const newState = extractStateFromMessages(messages);
if (!newState) {