Skip to content

fix(tab-bar): offer Resume in New Native Chat only while the tab's agent is running - #27520

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/cli-move-live-agent-only
Oct 12, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/cli-move-live-agent-only

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​98 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​98
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

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, #27742 50c5600c91d777dc445ac6720bd21de914b3ea65, combined QA commit 34ee6f3321cf18109b131a570d5d250f6f16d1e1. The baseline used the same current-main base, d4a55f583e880b6bbbbca11faa0a45d88646d3a6.

While Claude is running, including while waiting for input: after the harmless QA27742 reply, the sidebar row appears and the tab menu offers Resume in New Native Chat.

Real Claude running: sidebar row and Resume in New Native Chat offered

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.

Baseline after Claude exits: stale row and menu item remain

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.

Combined build after Claude exits: row and menu item gone, title retained

Conversation retained: Agent Session History still lists the same conversation after exit.

Session History retains the 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 .orca tree 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:

  • Four targeted suites passed: 49 tests, covering the menu resolver, parity with Session History, and tab-title synchronization.
  • Final-head GitHub CI finished with 14 passed and 15 skipped checks. Static analysis, typecheck, all five selected test shards, relay integration, and macOS/Windows package jobs passed. Skipped jobs were not exercised.
  • Reviewed idle agents, exit cleanup, restored status, split panes, both Claude and Codex, every title-lookup caller, folder workspaces, and the existing local-host restriction.

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

  • Not applicable; this change copies no skill-installer code or assets.

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

  • This PR is small and focused
  • Explained the problem, user-facing change, mechanism, and alternatives
  • Before/after visual proof attached
  • Reviewed correctness, security, and performance
  • Considered platforms, SSH/remote, and folder workspaces
  • Selected CI checks completed; skipped checks and remote QA gaps are stated above

…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.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fb4fd6b1-cc5e-44eb-9aff-718b70463202




📥 Commits

Reviewing files that changed from the base of the PR and between 0df25b7 and 06d746e.





📒 Files selected for processing (3)
  • src/renderer/src/components/tab-bar/tab-session-history-switch.test.ts
  • src/renderer/src/components/tab-bar/tab-session-history-switch.ts
  • src/renderer/src/lib/ai-vault-tab-title-requests.ts




Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.






📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The title-request collector now accepts an option to exclude retained and sleeping agent records. CLI tab-history lookup enables this option. Added tests cover restored agents, exited agents, title requests for retained or sleeping records, and split panes with running and exited agents.








Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 06d74

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 | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main behavior change: the Resume in New Native Chat action is available only while the tab's agent is running.
Description check Passed The description covers the required sections, user-facing behavior, implementation, rationale, testing, visual proof, limitations, and review notes. It states that no linked issue exists, which is acc…

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR







  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

brennanb2025 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

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, /exit removes both within seconds, the displayed title stays unchanged, and Session History keeps the conversation. The same-base main build reproduces the stale row/action; the native PowerShell control also passes. Fresh screenshots replace the earlier incomplete experiment in the PR body.

Fresh live QA on Windows high spec, with real Claude and the existing login in place. Both PRs were applied together: #27520 06d746eb1219c2c54e4ef3d4f0b6399f21868d3d, #27742 50c5600c91d777dc445ac6720bd21de914b3ea65, combined QA commit 34ee6f3321cf18109b131a570d5d250f6f16d1e1. The baseline used the same current-main base, d4a55f583e880b6bbbbca11faa0a45d88646d3a6.

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 .orca hashes stayed unchanged. All owned test apps exited; the QA controls and worktree were removed and verified gone. No source edits, pushes, PR merges, or merge-readiness approval. Earlier source-review/test/CI results in the body were not rerun by this QA lane.

@brennanb2025
brennanb2025 merged commit 5428bd9 into main Oct 12, 2026
29 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/cli-move-live-agent-only branch October 12, 2026 08:12
brennanb2025 added a commit that referenced this pull request Oct 12, 2026
…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.
brennanb2025 added a commit that referenced this pull request Oct 12, 2026
…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.
registered2nd pushed a commit to registered2nd/orca that referenced this pull request Oct 14, 2026
…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)
brennanb2025 added a commit that referenced this pull request Oct 15, 2026
…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)
brennanb2025 added a commit that referenced this pull request Oct 15, 2026
…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)
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