Skip to content

feat(web): agents copy the person on handoff mail (CL-8577) - #926

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-8577-cc-person-on-handoff
Sep 18, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-8577-cc-person-on-handoff

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Agent-to-agent mail in a workbench goes run to run and never lands in the person's mailbox, so a handoff was invisible in the transcript.
  • The roster block every room send appends now lists the person alongside the agents and tells agents to copy that address on any handoff.

Changes

  • apps/web/src/chat/room-roster.ts: RosterEntry gains a kind ("person" | "agent"); appendRoster adds a trailing instruction naming every person in the roster and telling agents to copy them in to on a handoff. stripRoster needed no change — it already discards everything from the Participants: marker onward.
  • apps/web/src/chat/threads-api.ts: sendToRoom now takes the full participant list (not just agents), builds the roster from the person(s) plus live agents, while to still targets only live agents.
  • apps/web/src/workbench-create.ts / apps/web/src/pages/workbench-room-page.tsx: pass the full participant list through to sendToRoom.
  • agents/myra/src/system-prompt.ts: one added sentence stating the same rule.

Testing

  • bun test apps/web/src/chat/room-roster.test.ts
  • bun run check (typecheck, lint, fmt, full test suite) — green

Findings on mail_send cc/comma support

  • @intx/tools-mail (0.3.0) mail_send schema has no cc field — only to: string | string[].
  • The underlying createOutboundMessage builder (vendor/intx/mime/src/mail-builder.ts) does support a cc field, but the mail tool never exposes it.
  • A comma-separated string in to is not viable: each string is validated as a single RFC-5322-ish address with /^[^@\s]+@[^@\s]+$/, so "a@x,b@x" fails validation. Multiple recipients must be passed as an array.
  • The instruction added therefore tells agents to add the person's address as another to recipient, not a cc.

Reader check

  • readRoomFolder/readRoom in threads-api.ts do not filter messages by participant/address match (unlike the one-on-one chat reader) — every message in the room mailbox's INBOX/Sent folders is already shown, author included, regardless of whether the person is a primary or secondary to recipient. No reader change was needed.

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8577

@TheGreatAxios
TheGreatAxios merged commit c4e6669 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