You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
=== LAST HANDOFF === inflates its own delivery counter on every compaction #341
Found while implementing #339, left untouched there because narrowing it inside that change would have been a silent scope extension.
What the user sees
A handoff note that was delivered once announces itself as already delivered 5 times. The number climbs through a session without anyone opening a new one.
Mechanism
At source=compact (and clear, and fork) the handoff fingerprint is unchanged from the previous fire, so scripts/session-start-hook.sh:878 takes the "already delivered" branch and increments DELIVERIES. SessionStart fires on all five sources; the counter is written as though it fired only on new sessions.
The counter's own wording — "already delivered N times" — is a claim about how many sessions have seen the note. A compaction is not a new session, and #206 already established exactly this rule for the capture-alive store: "SessionStart firing does not mean a new session id exists." This is that rule being violated one feature over.
Why it matters beyond the wrong digit
The count is what a reader uses to decide whether a handoff is stale and can be ignored. Four auto-compactions in one long session turn a note delivered once into one that reads as thoroughly seen — so the number does not merely drift, it argues for dismissing content that has in fact been read once.
Fix direction, not a prescription
#339 adds SESSION_START_SOURCE to this file, whitelisted and defaulting to empty. Gating the increment on it is now a one-line change. Whether clear and fork should also be excluded is the judgment call: clear genuinely replaces the context, so arguably it is a fresh delivery, while compact plainly is not.
Worth pinning with a test either way — the current behaviour has no coverage that distinguishes a second session from a second fire.
Activity
Gate the handoff delivery counter and the consolidation trigger on so…