fix(dashboard): don't mark agent inbox messages read when user views them

When the dashboard user browses another agent's mailbox (e.g. the CEO's
inbox), opening a message no longer triggers POST /messages/:id/read.
The previous behavior silently consumed the agent's unread state, so the
agent's heartbeat never surfaced the message and fn_read_messages (which
defaults to unread_only=true) returned nothing. Auto-mark-read now only
fires on the dashboard user's own inbox tab. Adds regression tests in
MailboxView.test.tsx and MailboxModal.test.tsx.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-06 08:01:30 -07:00
parent 4dc91edfb2
commit 6f46ab017f
5 changed files with 121 additions and 6 deletions

View File

@@ -0,0 +1,12 @@
---
"@runfusion/fusion": patch
---
Stop the dashboard from auto-marking another agent's messages as read when
the user opens them while browsing that agent's mailbox. Previously, viewing
a message in an agent's inbox (e.g. the CEO's mailbox) would call
`POST /messages/:id/read`, which silently consumed the agent's unread state.
The agent's heartbeat would then never see the message as pending, and the
agent's `fn_read_messages` tool (which defaults to `unread_only: true`)
returned nothing. The mark-as-read call now only fires for the dashboard
user's own inbox tab.