Repository navigation
fix(tab-bar): offer Resume in New Native Chat only while the tab's agent is running - #27520
Conversation
…ent is running The terminal tab menu found its conversation through the tab-title lookup, which also falls back to retained and sleeping records an exited agent leaves behind. Pass a running-agents-only option for the move; tab titles keep the remembered conversation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The Resume in New Native Chat menu item will now appear only for tabs with a running agent. Tab titles still use remembered conversations. No merge-blocking risk was found. Pre-merge checks |
|
|
After Claude quits in a Windows cmd.exe pane, a stale live record kept Resume in New Native Chat in the tab menu. Fresh real-Claude QA of this PR together with #27742 now passes: the running row/action appear, Fresh live QA on Windows high spec, with real Claude and the existing login in place. Both PRs were applied together: #27520 Optional real Codex was not tested; the reviewed launcher requires a separate wrapper/profile for it. Other platforms were not exercised. Real-home settings and |
…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.
…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.
…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)
…ent is running (#27520) The terminal tab menu found its conversation through the tab-title lookup, which also falls back to retained and sleeping records an exited agent leaves behind. Pass a running-agents-only option for the move; tab titles keep the remembered conversation. (cherry picked from commit 5428bd9)
…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
After Claude or Codex quit, right-clicking their terminal tab still offered Resume in New Native Chat because the menu used the conversation Orca remembered. The menu now ignores remembered conversations. With #27742 removing the stale Windows live record after exit, the item disappears when the agent quits. An agent waiting at its prompt still qualifies, and the tab keeps its conversation title.
What Changed
The menu now selects conversations from the existing live agent status records. Tab titles continue to use live, retained, and sleeping records.
In a split tab, a running agent's conversation is selected even when the focused pane belongs to an agent that has exited. Native chat tabs and their Resume in New CLI action are unchanged.
Why
The menu and tab titles already share the pane-to-conversation lookup. A small optional filter keeps their existing session matching and focused-pane selection together, while letting this action ignore remembered conversations. It adds no stored state or separate process check.
This option is also suitable for the pane-header action in #27184 when that branch is rebased; that PR is outside this change.
Linked Issue
Internal request; no linked issue.
Visual Proof
Fresh live QA on Windows high spec, with real Claude and the existing login in place. Both PRs were applied together: #27520
06d746eb1219c2c54e4ef3d4f0b6399f21868d3d, #2774250c5600c91d777dc445ac6720bd21de914b3ea65, combined QA commit34ee6f3321cf18109b131a570d5d250f6f16d1e1. The baseline used the same current-main base,d4a55f583e880b6bbbbca11faa0a45d88646d3a6.While Claude is running, including while waiting for input: after the harmless
QA27742reply, the sidebar row appears and the tab menu offers Resume in New Native Chat.Before — same baseline, after
/exit: native Claude had exited, but the sidebar still listed it and the tab menu still offered Resume in New Native Chat.After — both PRs, after
/exit: the sidebar row and menu item disappear. The displayed tab title stays QA27742 exact reply. Claude PID 53412 was first observed absent 1.047 s after the command; the sidebar row was first observed absent at 4.199 s (present at 3.143 s). These are sampling times, not an exact process-exit timestamp.Conversation retained: Agent Session History still lists the same conversation after exit.
Rows 1, 2, 3 and 5 passed. Optional real Codex row 4 was skipped: the reviewed launcher wraps only Claude, so Codex required a separate wrapper/profile setup. Other platforms and shells were not exercised in this run. Windows were hidden and driven through Chrome DevTools Protocol (CDP); no desktop input or focus changes. SHA-256 checks of the real Claude settings and
.orcatree matched before activation and after teardown; no hooks were installed into the real home. Screenshots are unaltered and include existing startup notices.Testing
Review verification on 06d746e:
AI Disclosure
Review
The architecture challenge and full review found no proven issue introduced by this diff. No source changes were made during review. Fresh combined Windows QA with #27742 passed the mandatory running, exit, history, baseline and PowerShell checks above. This completes the earlier incomplete UI experiment; it is not a merge-readiness approval.
Agent skill upstream boundary
Notes
The existing restart limitation remains: if an agent exits while Orca is closed but its terminal survives, the restored status can linger until Orca observes the return to the shell. This PR consumes that shared status and does not change reconciliation.
SSH and remote-runtime CLI moves retain their existing restriction. Folder workspaces use the same selection rule. No mobile-facing, persisted-data, or wire contract changed.
Checklist