Repository navigation
Chat tabs offer Hand Off to Another Agent in their right-click menu - #31782
brennanb2025 wants to merge 7 commits into
Conversation
A chat tab outside a terminal pane had no way to continue its conversation with another agent from the menu; only chats hosted in a terminal pane did. The usage-limit row's hand-off moves into a shared hook so the menu and the row open the same dialog with the same saved-transcript context.
|
Standalone native chats lacked the hand-off action already available in terminal panes. This adds Hand Off to Another Agent to the chat’s right-click menu and opens the existing chooser. On supported hosts, it uses the saved conversation, including earlier messages outside the loaded window, with a complete saved-text file for full context. Older hosts retain the existing loaded-message fallback. The six-round review, terminal design ruling, exact final contract correction, and independent final source/reference comparison are complete at Verification follows the current native-chat UI rule: renderer, host, and cross-version tests plus branch-only screenshots, with no real-agent QA round. The narrow registered/phone contract suites passed 68 tests. Exact-head PR workflow 39852286330 remains red solely on the inherited daemon socket flake, fixed on main by #31520, and its aggregate gate. This is not green CI. No live-agent hand-off, restart/upgrade, or cross-host file-reading result is claimed by the screenshot run. For Brennan's review Screenshot-only verification on Windows at the reviewed head, using an explicitly synthetic saved-chat fixture. No agent was launched and Start was not clicked. Native-chat context menu: The chooser opened from that row: Still required: #30955 and #31241 landing; the once-only integration merge; green full PR CI on that merged head; retargeting this PR to main. At integration, if the usage-limit auto-continue change has landed, pass the optional existing hand-off-started callback through the shared chooser for both entry points. |


Problem
Right-clicking in a chat tab offers Copy message, Find in chat, Move Tab to Split and Copy Orca Session ID. There is no way to continue that conversation with a different agent (for example, move a Codex chat over to Claude). The same right-click menu on a chat that lives inside a terminal pane already has "Hand Off to Another Agent…", but chat tabs opened on their own never got that row. The menu only adds it when the chat is hosted in a terminal pane.
What changes for you
Right-clicking anywhere in a chat tab now shows Hand Off to Another Agent, right under Find in chat. It opens the existing hand-off dialog, titled with the chat's name and set to its workspace, where you pick any installed agent and start. The new agent gets the chat's saved transcript file when the chat's host has one. Otherwise it gets the chat's loaded messages, labelled as chat messages. This is the same dialog and context that the usage-limit row's Hand Off button opens in #31241. Chats inside a terminal pane are unchanged and keep their existing row.
How
#31241 added a hand-off from a chat tab, but only inside the usage-limit row. That logic moves into one shared hook (
use-native-chat-hand-off.tsx). It asks the chat's host for the saved transcript when you click, builds the hand-off source and owns the dialog, and it still drops a request that a newer conversation has replaced. Two places use the hook:The agent list in the menu's dialog works like the existing terminal-pane row: the chat's own agent is still offered, so you can also start a fresh session with the same agent. Only the usage-limit row excludes the agent that hit its limit.
NativeChatStructuredSession.tsxis at its file-length limit, so it now passes its props through to the pane commands as one value instead of field by field. The pane-commands file becomes.tsxbecause it renders the dialog next to the menu.Differences from the common pattern
Testing
native_chatlaunch source, without excluding the chat's own agent.NativeChatStructuredSessiontest files pass. CI runs full lint and typecheck.Notes
Stacked on #31241, which is stacked on #30955. Merge those first, then retarget this PR to main. This PR reuses #31241's hand-off from a chat tab, so it can't land without it.
Author: @BrennanKB5