Skip to content

Chat tabs offer Hand Off to Another Agent in their right-click menu - #31782

Open
brennanb2025 wants to merge 7 commits into
brennanb2025/usage-limit-actionsfrom
brennanb2025/chat-menu-hand-off
Open

brennanb2025 wants to merge 7 commits into
brennanb2025/usage-limit-actionsfrom
brennanb2025/chat-menu-hand-off

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1020 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​951
Prod 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​691 $\color{#cf222e}{\Huge{\mathbf{−}}}$​257 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​434

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 usage-limit row, with the same extra reset triggers and "pick a different agent" default as before. Its behavior is unchanged.
  • The chat tab's menu commands, which add the row when the chat runs on the same host as its workspace.

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.tsx is 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 .tsx because it renders the dialog next to the menu.

Differences from the common pattern

  • Entry point (intended). The common pattern reaches hand-off from the composer's model picker, not from a right-click menu. Orca already offers this action as a right-click row on chats in terminal panes, and this was the requested place. A model-picker entry point would be a separate feature and is not included.
  • Context (intended). The new session is seeded with the old conversation and does not replace the provider in place, as in the common new-thread hand-off. Orca passes the saved transcript file (or loaded messages) through its existing hand-off dialog, which Continue a usage-limited chat with another account or agent #31241 already uses.

Testing

  • New test: a chat tab's menu offers Hand Off to Another Agent. Selecting it asks the chat's host for its saved transcript and opens the dialog with that transcript, the chat's title, its workspace and the native_chat launch source, without excluding the chat's own agent.
  • The existing usage-limit hand-off tests pass unchanged against the shared hook (stale-request drop, Continue Now superseding a pending hand-off, the database-backed messages fallback).
  • Run locally: the three menu test files and all eleven NativeChatStructuredSession test files pass. CI runs full lint and typecheck.
  • Real-app QA on the final head (pending: a Codex chat tab's right-click, then Hand Off to Claude, then a real reply that uses the transcript; plus an unchanged chat in a terminal pane and the usage-limit row).

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

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.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 22, 2026 02:34
@brennanb2025

Copy link
Copy Markdown
Contributor Author

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 271450a6ed0d3bd01b21f688dde7c5252cafe23b. Review fixes preserve saved questions and answers, prevent an older preparation from replacing a newer dialog or transcript file, and retain existing entry-point rules and older-host compatibility. No open proven P0/P1 remains. A P3 concern about changing the Context option while installed-agent discovery refreshes remains unproven; no speculative patch was added.

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:

Native-chat hand-off menu

The chooser opened from that row:

Hand-off chooser

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.

This branch has not been deployed

No deployments
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