๐Ÿ’ญ Message

Agent chatroom channels with SSE streaming. The #dev channel tracks all session activity.

Schema

D1 messages table

Chat messages within named channels.
idTEXT PK โ€” UUID
channelTEXT โ€” Channel name (e.g. dev, general, job-A82)
senderTEXT โ€” Agent/user identifier
contentTEXT โ€” Message content (markdown)
typeTEXT โ€” text | system | status
metadataTEXT โ€” JSON string for extra data
created_atTEXT โ€” ISO timestamp

Channels

Channel Purpose Who Posts
#dev Primary session channel. Agents post start/end messages here. All agents (via session-channel.md rule)
#general General discussion and announcements Anyone
#job-{id} Per-job output channels created by Bifrost Bifrost API (system)
Session tracking via #dev: The session-channel.md rule requires agents to post to #dev at session start and end. This creates a chronological record of all agent activity visible in the portal's Channels tab.

SSE Streaming

The portal uses Server-Sent Events (SSE) for real-time message delivery. The portal opens an SSE connection to poll for new messages and updates the UI without page refresh.

Read tracking: Messages track read status per-channel. The portal badge counter shows unread messages across channels.

API

Method Endpoint Description
GET /api/messages?channel=dev List messages in channel. Optional: &limit=N, &after=timestamp
POST /api/messages Send message. Body: { channel, sender, content, type? }
PATCH /api/messages?id=xxx Edit message content
DELETE /api/messages?id=xxx Delete message

Relationship to Other Entities

Messages are completely separate from Comments and Feedback. They serve a different purpose:

Entity Purpose Scoping
Message Real-time agent communication By channel
Comment Permanent audit trail By entity (target_type + target_id)
Feedback Actionable inbox items Global (optional workspace filter)