Fix: allow cron heartbeat payloads through filters (#2219) (thanks @dwfinkelstein)

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Shadow
2026-01-26 17:21:29 -06:00
committed by Shadow
parent 82746973d4
commit 91d5ea6e33
3 changed files with 37 additions and 32 deletions

View File

@@ -21,7 +21,11 @@ export async function prependSystemEvents(params: {
if (!trimmed) return null;
const lower = trimmed.toLowerCase();
if (lower.includes("reason periodic")) return null;
if (lower.includes("heartbeat")) return null;
// Filter out the actual heartbeat prompt, but not cron jobs that mention "heartbeat"
// The heartbeat prompt starts with "Read HEARTBEAT.md" - cron payloads won't match this
if (lower.startsWith("read heartbeat.md")) return null;
// Also filter heartbeat poll/wake noise
if (lower.includes("heartbeat poll") || lower.includes("heartbeat wake")) return null;
if (trimmed.startsWith("Node:")) {
return trimmed.replace(/ · last input [^·]+/i, "").trim();
}