feat(email): mailbox picker in the chat composer, and mailbox switches marked in the transcript - #318
Merged
Conversation
…s marked in the transcript
A chat thread is keyed by agent, not by account, so one conversation can
span mailboxes. The active account was inherited silently from whatever
the inbox happened to be showing: switching it swapped the assistant's
per-account instructions mid-thread with nothing in the transcript to
say so, and in the chat app — which has no inbox sidebar — the account
resolved only when the user had exactly ONE, so a multi-account user got
an unconfigured assistant that had to ask.
- AgentChat gains an optional mailbox picker next to the model selector
(mailboxes / activeMailboxId / onMailboxChange). It renders only when
mailboxes are supplied, so it is the email assistant's control and no
other agent sees it. Which inbox the assistant is working on is now a
visible, per-conversation choice.
- Switching mid-thread drops a marker in the transcript ("Now working on
<mailbox>") anchored to the message it followed, so the boundary is
readable when scrolling back. A switch before the first message needs
no marker and gets none.
- Email app: the picker points the assistant at a different mailbox
WITHOUT making the user leave the thread or change what they're
reading. The override is held against the inbox selection it was made
against, so moving the inbox drops it derivationally rather than via a
reset effect. Settings, persona and tool context all follow the chat's
mailbox, not the inbox's.
- Chat app: the picker replaces the one-account-only resolution, and now
defaults to the first account so a multi-account user starts somewhere
concrete instead of nowhere.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122zNo8kiZooLu49jsaSrQ6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A chat thread is keyed by agent, not by account, so one conversation can span mailboxes. The active account was inherited silently from whatever the inbox happened to be showing — switching it swapped the assistant's per-account instructions mid-thread with nothing in the transcript to say so. And in the chat app, which has no inbox sidebar, the account resolved only when the user had exactly one, so a multi-account user got an unconfigured assistant that had to ask.
AgentChatgains an optional mailbox picker next to the model selector (mailboxes/activeMailboxId/onMailboxChange). It renders only when mailboxes are supplied, so it's the email assistant's control and no other agent sees it. Which inbox the assistant works on is now a visible, per-conversation choice.Builds on #316, which made the assistant's behaviour per-account in the first place — this gives the user direct control over which account that is.
Testing
tsc --noEmitclean,next buildclean, vitest 141/141. Lint counts identical to baseline on all three touched files (AgentChat 13, chat/page 2, EmailAssistantChat clean) — no new issues.🤖 Generated with Claude Code
https://claude.ai/code/session_0122zNo8kiZooLu49jsaSrQ6
Generated by Claude Code