Where
spotify-releases/agent.ts (checkpoint persistence)
if (delivered && failed.length === 0) {
await saveLastCheck(ctx, today());
if (releases.length > 0) {
await saveNotified(ctx, [...notified, ...releases.map(releaseKey)].slice(-500));
}
} else {
ctx.log?.('warn', 'spotify-releases.checkpoint-not-advanced', { since, failedArtists: failed.length, delivered });
}
Problem
Both saveLastCheck and saveNotified are gated on delivered && failed.length === 0. When messages were delivered (delivered === true) but some artist fetch failed (failed.length > 0), saveNotified is skipped — so the already-notified releases are re-sent on the next run (duplicate notifications).
Suggested fix
Persist notified whenever delivered is true (records what was successfully sent), and keep advancing lastCheck gated on delivered && failed.length === 0 so failed artists are rescanned:
if (delivered && releases.length > 0) {
await saveNotified(ctx, [...notified, ...releases.map(releaseKey)].slice(-500));
}
if (delivered && failed.length === 0) {
await saveLastCheck(ctx, today());
}
Found by CodeRabbit while reviewing vendored snapshots in AgentWorkforce/skills#87.
Where
spotify-releases/agent.ts(checkpoint persistence)Problem
Both
saveLastCheckandsaveNotifiedare gated ondelivered && failed.length === 0. When messages were delivered (delivered === true) but some artist fetch failed (failed.length > 0),saveNotifiedis skipped — so the already-notified releases are re-sent on the next run (duplicate notifications).Suggested fix
Persist
notifiedwheneverdeliveredis true (records what was successfully sent), and keep advancinglastCheckgated ondelivered && failed.length === 0so failed artists are rescanned:Found by CodeRabbit while reviewing vendored snapshots in AgentWorkforce/skills#87.