Skip to content

feat: show whether a recipient is actually reading (#162) - #174

Merged
yonidavidson merged 1 commit into
mainfrom
feat/162-delivery-visibility
Aug 9, 2026
Merged

yonidavidson merged 1 commit into
mainfrom
feat/162-delivery-visibility

Conversation

@yonidavidson

Copy link
Copy Markdown
Owner

Closes #162. (Supersedes #170, auto-closed by GitHub when its base branch merged; same commit, rebased onto main.)

Every send reported sent <id> → <recipient>, including the ones the recipient could never retrieve: 25 sends reported success in one session while delivery was degraded, and no sender ever got a hint. sent has only ever meant queued.

What changed

  • src/bus.tslastRead on the agent record, stamped by markRead when an agent consumes its mailbox (inbox, ack). Only an existing registration is stamped: registrations are never purged, so a one-off inbox --as someone must not leave a permanent ghost on the roster. Plus unreadCounts() / unread(name) — per-recipient depth from keys alone, one list, no bodies.
  • src/cli.tssend warns when the evidence says nobody is picking the mail up: the recipient never registered under that name, or has unread stacking up with no consuming read within AGENTCOMM_STALE_READ_MS (6h). The warning rides --json too. agents gains unread depth and last-read age; network shows the same, plus unread for nobody — mail queued to names nobody ever registered, which a roster built from registrations alone cannot show at all.

Tests

test/bus.test.ts: unread counts (including unregistered mailboxes), lastRead stamped and preserved across heartbeats, and no registration conjured by a read. test/cli.e2e.test.ts: an unregistered recipient warns on the first send, a registered one only once mail stacks up unread, the warning stops after a real read, and network --json lists the unclaimed mailbox.

Every `send` reported `sent <id> → <recipient>`, including the ones the
recipient could never retrieve. In a session where several recipients were
failing to read, the bus reported success 25 times while delivery was
degraded, and no sender ever got a hint. `sent` has only ever meant
QUEUED.

The bus already knew enough to say more: pending inbox keys, and now a
`lastRead` stamp written when an agent actually consumes its mailbox. So
`send` warns when the evidence says nobody is picking the mail up — the
recipient never registered under that name, or has unread stacking up with
no consuming read in AGENTCOMM_STALE_READ_MS (6h). `agents` carries each
agent's unread depth and how long ago it last read; `network` shows the
same, plus a section for mail queued to names nobody ever registered,
which a roster built from registrations alone cannot show at all.

Counting is keys-only (one list, no bodies), and the read stamp rides
commands agents run a handful of times a session.
@yonidavidson
yonidavidson merged commit a208008 into main Aug 9, 2026
2 checks passed
@yonidavidson
yonidavidson deleted the feat/162-delivery-visibility branch August 9, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

send reports success with no signal that the recipient is not reading

1 participant