LearnNewsExamplesServices
Frontmatter
id10149
titleMailbox: extend memory-core healthcheck with inbox + outbox preview
stateClosed
labels
enhancementaiperformancecore
assigneesneo-gemini-pro
createdAtApr 21, 2026, 11:30 AM
updatedAtApr 22, 2026, 5:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/10149
authortobiu
commentsCount0
parentIssue10139
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 10147 Mailbox: Message node schema + addMessage / listMessages / getMessage / markRead
blocking[]
closedAtApr 22, 2026, 5:35 PM

Mailbox: extend memory-core healthcheck with inbox + outbox preview

Closed v13.0.0/archive-v13-0-0-chunk-5 enhancementaiperformancecore
tobiu
tobiu commented on Apr 21, 2026, 11:30 AM

Mailbox: extend memory-core healthcheck with inbox + outbox preview

Context

Parent #10139 phase 3. Healthcheck is called on every agent boot (AGENTS_STARTUP.md §6); piggybacking mail-preview is a free notification channel — zero new polling loop.

The Problem

Session start has no "previous-you (or anyone) left a message" signal. Agents discover stale handoffs through manual query or don't discover them. Amnesia boundary = guaranteed rediscovery cost per session.

The Architectural Reality

  • mcp__neo-mjs-memory-core__healthcheck returns structured JSON today; extension is additive.
  • Caller-identity resolved post-OAuth2; inbox scoping is a simple edge query.
  • Preview cap: 3 items inbox + 3 items outbox — tight ceiling.

The Fix

  • Extend payload with mailbox: {unreadCount: N, inbox: [...3], outboxRecent: [...3]}
  • Each preview item: {id, from, subject, createdAt, priority?} — subject truncated to ~60 chars
  • Query: two indexed SELECT against Message nodes with caller-identity scope; no FTS, no Chroma, no graph traversal beyond SENT_BY / SENT_TO lookups
  • Sorted by createdAt DESC; filters out archived + retracted
  • Zero-cost when empty

Acceptance Criteria

  • Healthcheck payload includes mailbox field
  • Inbox preview: up to 3 unread, most recent first
  • Outbox preview: up to 3 most recent sent (regardless of receiver state)
  • Truncated subject + stable item shape documented
  • Performance observability: healthcheck latency instrumented; no p95 regression vs baseline
  • Archived/retracted excluded from inbox preview

Out of Scope

  • Per-message priority-sorting (recency default; priority-sort if friction surfaces)
  • Full-text search in preview (use listMessages or semantic layer)
  • Healthcheck pagination (not needed at 3+3 cap)

Avoided Traps

  • Full bodies in preview. Rejected. Healthcheck is hot path; preview signals, doesn't read.
  • Preview count > 5. Rejected. Ceiling keeps healthcheck cheap — every agent polls on every boot.

Related

  • Parent: #10139
  • Depends on: Message schema sub, #10016 OAuth2 (identity scoping)
  • Files: ai/mcp/server/memory-core/ healthcheck handler

Origin Session ID: 71dc3cd8-d39d-48e1-ac62-e240ca67d1a5

tobiu added the enhancement label on Apr 21, 2026, 11:30 AM
tobiu added the ai label on Apr 21, 2026, 11:30 AM
tobiu added the performance label on Apr 21, 2026, 11:30 AM
tobiu added the core label on Apr 21, 2026, 11:30 AM
tobiu added parent issue #10139 on Apr 21, 2026, 11:32 AM
tobiu marked this issue as being blocked by #10147 on Apr 21, 2026, 11:33 AM
tobiu cross-referenced by #10158 on Apr 21, 2026, 3:23 PM
tobiu cross-referenced by #9999 on Apr 21, 2026, 7:03 PM
tobiu cross-referenced by #10139 on Apr 21, 2026, 10:27 PM
tobiu cross-referenced by #10147 on Apr 21, 2026, 10:30 PM
tobiu cross-referenced by PR #10167 on Apr 21, 2026, 11:06 PM
tobiu referenced in commit 35dc531 - "feat(mcp): implement mailbox preview in healthcheck (#10149) (#10177) on Apr 22, 2026, 5:35 PM
tobiu closed this issue on Apr 22, 2026, 5:35 PM