Skip to content

feat(hub): mailbox send to an agent triggers its deployment and keeps the person's Sent copy (CL-8437) - #871

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-8437-sent-copy
Sep 18, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-8437-sent-copy

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

A person's message to an agent is now ordinary mail from their own mailbox, so it leaves a durable Sent copy.

Hub (Corbits block only)

  • senderAddressFor returns the stock human address form <principal.refId>@<domain> (drizzle lookup on principal), so the Sent copy and the agent's reply share one identity.
  • deliver (new apps/hub/src/mailbox-send.ts) splits recipients: a run address is fired through stock's own POST /api/tenants/:t/workflows/:runId/mail (replaying the caller's session against the hub app, so grants and signing are stock's); everything else keeps the persistMail path. Failures are reported through reportError and thrown, never swallowed.

Web

  • startChat/replyInChat post to /mailbox/me/inbox/send with to: [agentAddress] and inReplyTo on replies.
  • The workbench.chat.sent.<tenantId> localStorage cache is gone; a chat is now every mail turn on one agent's run, read from the mailbox (Sent + INBOX), and a chat's id is the agent's run id.
  • Everything stays on TanStack Query; the only effect is the pre-existing inbox SSE subscription.

Known gap

@corbits/mailbox (pinned 8cb5db96) does not list the Sent folder: LIST_FOLDERS in mount.ts is INBOX | Archive | Trash, so GET /me/inbox?folder=Sent answers 400 and the person's own turns will not render until the library allows it. Send, Sent persistence and the trigger path are complete.

… the person's Sent copy (CL-8437)

A person's message to an agent now goes through their own mailbox: the
Sent copy is durable, and the hub's deliver seam hands the frame to
stock's workflow trigger route instead of the mail persist path, which
has no endpoint for a human sender. The mailbox sender address is the
stock human form <refId>@<domain>, so the Sent copy and the agent's
reply share one identity.

The chat UI reads both sides from the mailbox and the localStorage sent
cache is gone.
@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8437

@TheGreatAxios
TheGreatAxios merged commit c6f46af into main Sep 18, 2026
4 checks passed
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.

1 participant