Found by accident while cleaning up after a test loop, on the shipped 0.1.64-beta2 (build 252).
What happens
A loop watching the Mailroom while it is busy has matching posts staged to its memory rather than typed in live — that is the documented design, the same path a --follow-up message takes. But:
graphcode mail watch --off removes the subscription and does not cancel or drain what is already staged.
- Staged deliveries keep arriving for many minutes afterwards, in strict post order.
- They arrive even though the reader's cursor is already past them —
lastMailroomRead = 353 while posts #276, #277, #280, #281 were still being delivered.
- At least one was delivered twice (
#280 arrived two times).
Evidence
The watching node's persisted state after --off shows no watch at all:
PerfTriage mailroom-related keys: ['lastMailroomRead']
lastMailroomRead = 353
So the subscription is genuinely gone from the graph, and the deliveries are coming from a queue that --off does not reach.
Sequence observed: filler 1 of 70, 2 of 70, 3, 4, 5, 5 (duplicate), 6 … continuing after the watch was turned off twice, re-scoped to a different topic in between, and the inbox marked read to #353.
Why it matters
- There is no way to stop it.
--off is the only control, and it does not apply to in-flight deliveries. A loop that accidentally subscribes to a busy topic will be fed that backlog into its context regardless of what its operator does — and for an agent session, that is context budget spent on posts it has already read.
- The duplicate is the more serious half. Delivery is supposed to be at-most-once into a session; a post arriving twice means a watcher cannot treat delivery as a signal to act exactly once.
- Redundant with the cursor: delivering posts below
lastMailroomRead contradicts what the cursor is for.
Suggested behaviour
--off should drop staged-but-undelivered posts for that watcher, not just the subscription.
- A staged post whose id is at or below the reader's
lastMailroomRead should be dropped rather than delivered.
- Delivery should be idempotent per post id per watcher.
Related
This is the delivery half of the Mailroom, which #293 did not touch — that PR rewrote how mail is read. Every review in the #288 series concentrated on the read path, so delivery has had no scrutiny. MailWatcher was created to test exactly this and found the ordering side; this is the teardown side.
Related: #288, #293
🤖 Generated with Claude Code
https://claude.ai/code/session_01BP43ags4cn8fq2ZZdv85J9
Found by accident while cleaning up after a test loop, on the shipped 0.1.64-beta2 (build 252).
What happens
A loop watching the Mailroom while it is busy has matching posts staged to its memory rather than typed in live — that is the documented design, the same path a
--follow-upmessage takes. But:graphcode mail watch --offremoves the subscription and does not cancel or drain what is already staged.lastMailroomRead = 353while posts#276,#277,#280,#281were still being delivered.#280arrived two times).Evidence
The watching node's persisted state after
--offshows no watch at all:So the subscription is genuinely gone from the graph, and the deliveries are coming from a queue that
--offdoes not reach.Sequence observed:
filler 1 of 70,2 of 70,3,4,5,5(duplicate),6… continuing after the watch was turned off twice, re-scoped to a different topic in between, and the inbox marked read to#353.Why it matters
--offis the only control, and it does not apply to in-flight deliveries. A loop that accidentally subscribes to a busy topic will be fed that backlog into its context regardless of what its operator does — and for an agent session, that is context budget spent on posts it has already read.lastMailroomReadcontradicts what the cursor is for.Suggested behaviour
--offshould drop staged-but-undelivered posts for that watcher, not just the subscription.lastMailroomReadshould be dropped rather than delivered.Related
This is the delivery half of the Mailroom, which #293 did not touch — that PR rewrote how mail is read. Every review in the #288 series concentrated on the read path, so delivery has had no scrutiny.
MailWatcherwas created to test exactly this and found the ordering side; this is the teardown side.Related: #288, #293
🤖 Generated with Claude Code
https://claude.ai/code/session_01BP43ags4cn8fq2ZZdv85J9