Skip to content

chat-ui: composer sends through POST /me/inbox/send (CL-8175) - #798

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-8175-composer-send
Sep 17, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-8175-composer-send

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • The composer's send path now posts straight to @corbits/mailbox's POST /me/inbox/send ({ to, body, inReplyTo? }) instead of the legacy @corbits/chat message route — matching the reads, which already moved onto the mailbox in CL-8174.
  • to is every other participant's mailbox address (Workbench.participants, minus the signed-in sender by principal-id local part). inReplyTo is the RFC Message-ID of the thread root (or the specific message being replied to when starting a fresh thread) — resolved from the loaded feed's own messages, since openThreadId/pendingParentMessageId are mailbox uids, not wire ids.
  • Deleted the legacy sendMessage client, its SendMessageOptions/MessageInviteInput types, and the now-unused SentMessage schema; added sendInboxMessage in their place.
  • instant-agent-create.ts's opening-message send (new-workbench picker) moved onto the same call: it now invites each selected agent first (inviteAgent, which returns the agent's own address) and sends the opening message to those addresses.
  • MessageItem gained an optional messageId (the RFC Message-ID), populated by mailbox-timeline.ts for every mail-derived row.

Known gaps (left for follow-up, not moved off the old route)

  • Attachments: the mailbox send wire has no attachment field, so a composer submit with a file attachment now sends only its text — attachments are silently dropped rather than shimmed. No mail-attachment API exists to move this onto.
  • Mention pre-invite (invite on MessageSendOptions): the chat route resolved "Bring in…" mention picks server-side before the send; the mailbox route has no such concept, so that fan-out is gone from the composer's own send path. Inviting an agent explicitly (Settings → Agents / /invite) still works.
  • instant-agent-create.ts's opening message is only sent when at least one agent was selected — mail requires a non-empty to, so an opening message typed with zero agents picked is no longer attempted (previously it posted into an ownerless empty room).

Test plan

  • bun run typecheck — clean outside packages/chat-ui/**/*.test.* (another agent is deleting/rewriting those in parallel per the dispatch instructions; two pre-existing test files there now fail to compile against the deleted sendMessage export and the new useOptimisticSends args)
  • bun run lint
  • bun run fmt
  • bun test in apps/web — 768 pass, 3 pre-existing unrelated Tailwind-CSS failures
  • bun test in packages/chat-ui — failures are confined to packages/chat-ui/**/*.test.* files (out of scope per dispatch instructions)

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CL-8175

@TheGreatAxios
TheGreatAxios merged commit e0b1001 into main Sep 17, 2026
4 of 5 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