Repository navigation
Terminal header button: Resume in New Native Chat replaces Show chat view - #27184
Conversation
…ative chat The pane header's "Show chat view" toggle is replaced by the tab menu's "Resume in New Native Chat" move. The Session History lookup runs on click, so an always-visible header never scans in the background. A pane already in chat view keeps its "Show terminal" way back.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change replaces the chat-view toggle with a Resume in New Native Chat button that is limited to eligible Claude and Codex panes. No concrete merge-blocking risk is evident from the supplied context. The author lists a few known edge cases as deferred. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
107bd526-993d-4f3c-9bae-cf6888b651a2
📒 Files selected for processing (15)
src/renderer/src/components/tab-bar/TabSessionSurfaceSwitchMenuItems.tsxsrc/renderer/src/components/tab-bar/tab-session-history-switch.tssrc/renderer/src/components/tab-bar/tab-session-switch-actions.tssrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneResumeInChatButton.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneResumeInChatButton.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneSurface.tsxsrc/renderer/src/components/terminal-pane/use-terminal-pane-projection.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…re subscription Keeps a mounted terminal pane inside its pinned store-listener budget.
… that already holds it The header "Resume in New Native Chat" button gated on chat-view eligibility but looked up the tab's best conversation, so a Grok pane beside a Claude pane resumed the Claude conversation, and Grok/OpenCode panes showed a button that always failed with a "try again" toast. - Map one pane to its conversation with the tab-title mapping narrowed to that pane (same sources, same Claude/Codex rule), for both the button's visibility and its click; this also keeps the button after the agent exits, as the tab menu does. - A conversation a native chat already holds now matches its history row; the move's gate still refuses it (tab menu unchanged, pinned in the parity test), and the button opens that chat. - Distinct messages: nothing saved yet, cannot be resumed in a native chat, or the existing generic failure. The click forces a fresh scan like the panel's Refresh does. - Call the plain resume launch directly; drop the shared actions module and restore the tab menu. - A tab closed during the lookup no longer opens a chat.
…te is refused On a local workspace whose project runs in WSL (or needs runtime repair), the header button showed on Claude/Codex panes, but native chat cannot launch there, so every click said the conversation can't be resumed while the tab menu offered nothing. The button's visibility now also asks the same launch-route check the Session History row gate uses (structuredAgentSessionLaunchFeasible).
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Match the pane’s history row by a stable identity. · tab-session-history-switch.ts:159-160
src/renderer/src/components/tab-bar/tab-session-history-switch.ts:159-160
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMatch the pane’s history row by a stable identity.
findTabSessionHistoryRowreturns the first row that matches onlyagentandsessionId. The history list preserves distinct rows with different execution hosts and file paths, even when those fields match the pane lookup.If the first matching row belongs to another transcript or structured chat, the terminal button uses that row. A structured row is passed to
activateAiVaultStructuredSession, which activates the row’sworkspaceIdandsessionId. The structured-row eligibility rejection does not protect this path.Carry the pane’s stable history-row identity into
TabSessionHistorySubjectand match it at this boundary. Do not select an arbitrary first row when the identity remains ambiguous.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
80046eaa-ae58-472c-8469-60e749e862ed
📒 Files selected for processing (2)
src/renderer/src/components/tab-bar/tab-session-history-switch.test.tssrc/renderer/src/components/tab-bar/tab-session-history-switch.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Review status: ready for your merge decision (head The problem. The top-right button on an agent terminal pane was "Show chat view". It flipped the pane into the old chat layout, and that chat/terminal switch is being removed. This PR makes that button do what the tab's right-click Resume in New Native Chat does. Where the first version went wrong. In review, the button showed in places where the click could never work:
What changes for you now:
Fixed in review (
Deferred (not fixed here):
Verified:
Not verified:
Two small things the run noticed, neither caused by this PR:
Update (10-12): synced with main; head You decided the move into a native chat should only be offered while Claude/Codex is actually running in the terminal, not from a remembered conversation after it exits. That landed for the tab menu in #27520, along with #27742 (Orca now notices an agent exit in cmd.exe/Git Bash terminals). This PR now follows the same rule:
|
…context-menu # Conflicts: # src/renderer/src/components/tab-bar/tab-session-history-switch.ts # src/renderer/src/lib/ai-vault-tab-title-requests.ts
…nt is running The tab menu now offers Resume in New Native Chat only while the tab's agent runs (#27520). The header button still found its pane's conversation from the retained or sleeping record an exited agent leaves behind, so it stayed after exit. The pane lookup now honours the same runningAgentsOnly option, and both the button's visibility and its click pass it.
…ing agent Every caller of resolvePaneAiVaultTitleRequest asked for running agents only, so its retained and sleeping sources were never read. The pane lookup now maps just the pane's live agent, and collectAiVaultTitleRequests returns to main's shape, sharing only the live-agent mapping with it.
…view (stablyai#27184) * feat(terminal-pane): header button resumes the CLI session in a new native chat The pane header's "Show chat view" toggle is replaced by the tab menu's "Resume in New Native Chat" move. The Session History lookup runs on click, so an always-visible header never scans in the background. A pane already in chat view keeps its "Show terminal" way back. * fix(terminal-pane): fold the resume gate into the pane's existing store subscription Keeps a mounted terminal pane inside its pinned store-listener budget. * fix(terminal-pane): resume the pane's own conversation, open the chat that already holds it The header "Resume in New Native Chat" button gated on chat-view eligibility but looked up the tab's best conversation, so a Grok pane beside a Claude pane resumed the Claude conversation, and Grok/OpenCode panes showed a button that always failed with a "try again" toast. - Map one pane to its conversation with the tab-title mapping narrowed to that pane (same sources, same Claude/Codex rule), for both the button's visibility and its click; this also keeps the button after the agent exits, as the tab menu does. - A conversation a native chat already holds now matches its history row; the move's gate still refuses it (tab menu unchanged, pinned in the parity test), and the button opens that chat. - Distinct messages: nothing saved yet, cannot be resumed in a native chat, or the existing generic failure. The click forces a fresh scan like the panel's Refresh does. - Call the plain resume launch directly; drop the shared actions module and restore the tab menu. - A tab closed during the lookup no longer opens a chat. * fix(terminal-pane): hide Resume in New Native Chat where the chat route is refused On a local workspace whose project runs in WSL (or needs runtime repair), the header button showed on Claude/Codex panes, but native chat cannot launch there, so every click said the conversation can't be resumed while the tab menu offered nothing. The button's visibility now also asks the same launch-route check the Session History row gate uses (structuredAgentSessionLaunchFeasible). * fix(terminal-pane): offer the header resume only while the pane's agent is running The tab menu now offers Resume in New Native Chat only while the tab's agent runs (stablyai#27520). The header button still found its pane's conversation from the retained or sleeping record an exited agent leaves behind, so it stayed after exit. The pane lookup now honours the same runningAgentsOnly option, and both the button's visibility and its click pass it. * refactor(terminal-pane): the header's pane lookup reads only the running agent Every caller of resolvePaneAiVaultTitleRequest asked for running agents only, so its retained and sleeping sources were never read. The pane lookup now maps just the pane's live agent, and collectAiVaultTitleRequests returns to main's shape, sharing only the live-agent mapping with it. (cherry picked from commit c345741)
…view (#27184) * feat(terminal-pane): header button resumes the CLI session in a new native chat The pane header's "Show chat view" toggle is replaced by the tab menu's "Resume in New Native Chat" move. The Session History lookup runs on click, so an always-visible header never scans in the background. A pane already in chat view keeps its "Show terminal" way back. * fix(terminal-pane): fold the resume gate into the pane's existing store subscription Keeps a mounted terminal pane inside its pinned store-listener budget. * fix(terminal-pane): resume the pane's own conversation, open the chat that already holds it The header "Resume in New Native Chat" button gated on chat-view eligibility but looked up the tab's best conversation, so a Grok pane beside a Claude pane resumed the Claude conversation, and Grok/OpenCode panes showed a button that always failed with a "try again" toast. - Map one pane to its conversation with the tab-title mapping narrowed to that pane (same sources, same Claude/Codex rule), for both the button's visibility and its click; this also keeps the button after the agent exits, as the tab menu does. - A conversation a native chat already holds now matches its history row; the move's gate still refuses it (tab menu unchanged, pinned in the parity test), and the button opens that chat. - Distinct messages: nothing saved yet, cannot be resumed in a native chat, or the existing generic failure. The click forces a fresh scan like the panel's Refresh does. - Call the plain resume launch directly; drop the shared actions module and restore the tab menu. - A tab closed during the lookup no longer opens a chat. * fix(terminal-pane): hide Resume in New Native Chat where the chat route is refused On a local workspace whose project runs in WSL (or needs runtime repair), the header button showed on Claude/Codex panes, but native chat cannot launch there, so every click said the conversation can't be resumed while the tab menu offered nothing. The button's visibility now also asks the same launch-route check the Session History row gate uses (structuredAgentSessionLaunchFeasible). * fix(terminal-pane): offer the header resume only while the pane's agent is running The tab menu now offers Resume in New Native Chat only while the tab's agent runs (#27520). The header button still found its pane's conversation from the retained or sleeping record an exited agent leaves behind, so it stayed after exit. The pane lookup now honours the same runningAgentsOnly option, and both the button's visibility and its click pass it. * refactor(terminal-pane): the header's pane lookup reads only the running agent Every caller of resolvePaneAiVaultTitleRequest asked for running agents only, so its retained and sleeping sources were never read. The pane lookup now maps just the pane's live agent, and collectAiVaultTitleRequests returns to main's shape, sharing only the live-agent mapping with it. (cherry picked from commit c345741)
ELI5
The small button at the top right of an agent terminal used to say "Show chat view" and flipped the terminal into the old chat layout. That view switch is being removed. The button now does what right-clicking the tab and choosing Resume in New Native Chat does: it opens the conversation in that terminal in a new native chat.
What Changed
Before: in an agent terminal (Claude, Codex, and so on), the top-right pane button was "Show chat view". It switched the pane into the old chat view, which we're removing. The only way to move a terminal conversation into a native chat was the tab's right-click menu.
After:
Mechanism:
TerminalPaneResumeInChatButton. On click it runs the tab menu's Session History lookup, narrowed to the pane the button sits on (resolvePaneAiVaultTitleRequest) and to the agent running there. In a split, it can never pick up another pane's conversation. Then it follows the tab menu's own decision (resolveTabSessionSwitch):resumeAiVaultSessionInNewChat;activateAiVaultStructuredSession, the same thing Session History's Resume does for a conversation already open in a chat.ai-vault-tab-title-requests.tsgains a single-pane lookup (resolvePaneAiVaultTitleRequest) that reads only the agent running in that pane, mapped the same way as the tab-wide list. Like the tab menu since fix(tab-bar): offer Resume in New Native Chat only while the tab's agent is running #27520, it ignores the retained and sleeping records an exited agent leaves behind; the button uses it both for whether it shows and for what the click looks up. The tab-wide list is unchanged, so tab titles still keep an exited agent's conversation.structuredAgentSessionLaunchFeasible). That check is what hides it for WSL projects. It reads the same store subscription the pane already had, so the pane adds no new listeners.Why
The tab menu only offers the move after a fresh Session History lookup. Only that lookup knows whether a chat already holds the conversation, whether a transcript exists yet, and the folder it was recorded in. A header button is always on screen, so running that lookup for every agent pane in the background would add history scans the tab menu deliberately avoids. Running it on click keeps the result fresh and costs nothing until the button is used.
Visibility uses the same facts the tab menu's gate uses, as far as they are known without the lookup, so the button doesn't show where the click is certain to fail.
Considered and not chosen:
Not in this PR: the terminal's own right-click menu still has "Switch to chat view". The ask was about the header button only.
Linked Issue
N/A (internal).
Visual Proof
Live run on macOS (M4Air) of a production build in a hidden test profile, with a Claude stand-in running in the terminal. Before is
main; after is this branch (the screenshots show the running state, which the running-only change doesn't alter).Split tab: only the active Claude pane has the button.
Click: a new native chat opens with the conversation.
Clicking the terminal's button again switches to that chat (still two tabs, no toast).
A plain shell has no resume button.
A conversation with nothing saved yet:
Testing
TerminalPaneResumeInChatButton.test.tsxcovers:tab-session-history-switchtests cover the button hiding once the agent exits, whether a retained or a sleeping record remains (same as the tab menu), SSH and WSL hiding, and owned rows. The parity test shows the tab menu still offers nothing for a conversation a chat already holds.TerminalPaneHeaderOverlay.test.tsx: the active pane offers the resume button and no "Show chat view"; a chat-view pane keeps "Show terminal".Existing tab menu, tab-title sync and Session History tests pass; tab titles still keep an exited agent's conversation.
orca-ci-checks(lint, code quality, localization, typecheck) passes locally, except the Bun-basedtypecheck:cistep, which fails on this machine's older Bun before checking anything; the regularpnpm run typecheckpasses and CI runstypecheck:cion its own Bun.Live Electron run on macOS: see Visual Proof. Not run live: Windows, WSL and SSH; those rest on the unit tests.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)