Skip to content

Create worktree, Create folder and continuation pickers offer each agent as a chat or its CLI, like the "+" menu - #31189

Merged
brennanb2025 merged 10 commits into
mainfrom
brennanb2025/agent-picker-surface
Oct 21, 2026
Merged

brennanb2025 merged 10 commits into
mainfrom
brennanb2025/agent-picker-surface

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​837 $\color{#cf222e}{\Huge{\mathbf{−}}}$​115 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​722
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​794 $\color{#cf222e}{\Huge{\mathbf{−}}}$​198 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​596

ELI5

The "+" menu in the tab bar already lets you start an agent either as a chat (click its row) or in a terminal (hover the row and click its terminal button). The agent picker in Create worktree, Create folder and the "continue this session" dialog couldn't do that: it showed a flat list, and after you clicked Create your settings decided chat or terminal. Now those pickers show the same rows and the same terminal button.

What Changed

Before: the Create worktree "Agent" picker listed every agent flat (Claude, Codex, … Cursor). Whether the new workspace opened Claude as a chat or in a terminal came only from Settings, so starting Claude in a terminal for one new worktree meant changing a global setting first.

After:

  • The picker lists the agents that can open as a chat first, then a separator and the agents that only run in a terminal, labelled "(CLI)". Blank Terminal stays at the top.
  • Picking an agent: clicking a chat row picks the chat. Hovering a row shows its terminal button, and clicking it picks the CLI; the field then reads "Claude (CLI)". With the keyboard, ArrowRight moves to the terminal button and Enter picks it.
  • Reopening the list: the picked row keeps its terminal button lit.
  • What Create starts: a terminal pick starts the agent in a terminal even when chats are your default. The displayed chat or terminal choice is used when submitting. Create retains its existing terminal fallback if the host declines a chat after creation. For continuation, an explicit chat pick reports a host decline; an untouched default retains its fallback.
  • Agents the host can't open as a chat (over SSH, in WSL, or for a continuation that starts in a subfolder) show "No chat …" with the reason and are still offered under "(CLI)".
  • With Chat UI off the list looks exactly as it does today, with no buttons and no "(CLI)".
  • Unchanged pickers: Automations (they always run in a terminal) and Source Control actions (their pick is saved as a recipe; remembering a surface there would be a new saved field).

Mechanism:

  • One row list. The pickers now build their rows the way the "+" menu does (useNewTabAgentMenuRows). That hook now accepts a workspace that doesn't exist yet (repo and host), and an optional start directory for continuations.
  • One terminal button. The button is a single shared component, used by both the "+" menu and the picker. Each list keeps its own keyboard handling: the menu moves focus into the button, while the picker keeps focus in its search box and treats ArrowRight as "use the terminal button".
  • Create. The form derives its displayed choice and readiness together, then captures the accepted launch route before asynchronous preparation. A terminal pick stays terminal even if settings change during preparation. A chat pick retains Create's existing fallback when the newly created workspace host declines chat. Continuation preserves whether chat was explicitly picked so a later refusal cannot silently change that explicit choice.

Why

Why reuse the "+" menu's rows. It is the common pattern to keep one agent picker across new-tab and create-workspace flows, with the chat/terminal choice carried on the launch request. Reusing the menu's rows means the picker and the menu can't disagree about which agents can chat on a host.

What the reviewers considered. Two alternatives were weighed:

  • moving desktop Create worktree onto the host's agent.launch request now;
  • a separate chat/terminal toggle next to the picker.

Moving onto agent.launch is already planned and sequenced in the launch-unification work, so this PR does not duplicate it. The separate toggle doesn't match the "+" menu, and the design of this one was approved beforehand.

Follow-up #31191 adds the same choice to the agent.launch request and a --surface chat|terminal option on orca agent launch and orca worktree create.

Linked Issue

Internal (maintainer).

Visual Proof

Real Electron QA compared exact branch 98c7fca1628f302f9b3ea9831885f6aa07d10e25 with main 582efa79897f8bcd47581a270dabbace51122f39 on M4Air, using hidden Chrome DevTools Protocol (CDP) control. Codex drove the app through qa-drive; real Claude Code 2.1.306 and Codex 0.163.0 ran under isolated homes through the load balancers. Both agent connectivity checks and real replies passed. Ticket #1084 is released and all owned test processes are stopped.

Create worktree, Create folder and root continuation each completed chat and terminal launches with real replies on both heads. Continuations carried the original context and retained the source/group; the untouched default also delivered context and replied. Worktree setup/default tabs ran and all six setup markers completed. The branch exercised the terminal button, (CLI) label, ArrowRight then Enter, selected-button reopening, cancellation/dismissal reset, and plain mode. A real unresolved-owner dialog settled with no runnable agents and recovered when its owner was restored, without borrowing another host's inventory.

Two existing bugs reproduced on both exact heads: Setup can take selection/focus from the new chat (STA-10869), and subfolder continuation starts the destination agent at the workspace root (STA-8416). The bounded focus order was branch Setup then Chat, main Chat then Setup; it establishes baseline occurrence, not relative failure frequency. Actual first destination Bash pwd confirmed the cwd failure on both heads. Evidence was added to the existing tickets; neither is labelled intended behavior or fixed here. No PR-exclusive defect was established.

Flow Branch Main
Create worktree: Codex chat; branch repeat / main first Branch Create worktree: Codex chat; branch repeat / main first Main Create worktree: Codex chat; branch repeat / main first
Create worktree: Claude terminal reply Branch Create worktree: Claude terminal reply Main Create worktree: Claude terminal reply
Create folder: Claude chat reply Branch Create folder: Claude chat reply Main Create folder: Claude chat reply
Create folder: Codex terminal reply Branch Create folder: Codex terminal reply Main Create folder: Codex terminal reply
Root continuation: Claude chat reply Branch Root continuation: Claude chat reply Main Root continuation: Claude chat reply
Root continuation: Claude terminal context/reply Branch Root continuation: Claude terminal context/reply Main Root continuation: Claude terminal context/reply
Existing Setup focus race; branch first / main repeat Branch Existing Setup focus race; branch first / main repeat Main Existing Setup focus race; branch first / main repeat
Existing subfolder continuation: destination pwd is root Branch Existing subfolder continuation: destination pwd is root Main Existing subfolder continuation: destination pwd is root
Committed CLI choice on reopen Unresolved owner: empty, disabled Owner restored: normal picker
CLI button remains selected No runnable agents for unresolved owner Owner hydration recovers agents

Testing

The exact-head full PR Checks workflow 39574162962 is green, including aggregate PR checks passed, static analysis/typecheck, all five unit-test shards, relay integration, and Linux/Windows packaging. The final main merge passed 10 named files / 43 tests. A test-only ownership-fixture correction then passed 3 named files / 16 tests and commit hooks; production code is identical to the independently checked merge.

The real-hook unresolved-owner regression covers ambiguous/missing restored owners, no unrelated inventory/probes, disabled readiness, and recovery on hydration. The independent final readiness and whole-mechanism comparison found no new proven defect; counsel was skipped as requested. All review threads are resolved.

Existing regression tests pin the edges that were not fault-injected live. Paths below are relative to src/renderer/src/; assertions use controlled asynchronous seams and mocked launch boundaries, so they do not prove rendered focus or a real provider refusal:

  • Cold Create click and Ctrl/Meta+Enter refusal, blank/setup-only/terminal independence, and local-to-SSH selection repair: components/NewWorkspaceComposerModal.agent-surface.test.tsx, “gates the selected chat at click/keyboard, preserves terminal and blank exceptions, and repairs host changes”.
  • Delayed preparation with changed settings: hooks/composer-state/quick-creation-execution.test.ts, “carries the accepted route across preparation and retains CLI startup/prompt under chat defaults”.
  • Delayed folder creation, host-decline fallback and explicit terminal startup: components/sidebar/folder-workspace-composer-submit-surface.test.ts, “starts the CLI in a terminal for a terminal pick even when chats are the default”.
  • Stale installed/catalog facts with an authoritative host refusal: components/NewWorkspaceComposerModal.agent-surface.test.tsx, “submits the untouched refusal-aware OpenCode CLI instead of the registered catalog chat”.
  • Worktree chat decline after materialization: lib/worktree-creation-structured-session-host-decline.test.ts, “opens the request's agent terminal without pulling the user onto the new workspace” and “opens the request's agent terminal in place, with no chat, leaving the user where they are”.
  • Continuation loading gate and displayed root/subfolder choice: components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx, “clears failed detection, gates unresolved Start, and submits the displayed root/subfolder choice”.
  • Delayed continuation detection/settings and explicit chat refusal versus untouched fallback: lib/launch-agent-session-continuation.test.ts, “retains the accepted route across detection, and explicit chat declines without the preference fallback”.
  • Row click, terminal button, ArrowRight+Enter, cancellation, committed CLI state, plain mode and exact search: components/agent/AgentCombobox.surface.test.tsx.

Limits: no natural live provider decline occurred; refusal/fallback and route stability across asynchronous changes are supported by source/regression tests. SSH/WSL/paired-host, mobile, Windows/Linux and assistive behavior were not exercised in this macOS QA lane. Folder creation ignored YAML setup/default tabs on both heads. The focus sample is bounded; unproven console warnings and terminal replay errors remain in the private report, with no observed terminal failure. These limits do not replace the completed normal launch/reply paths.

  • Current-head real Electron QA complete, with screenshots and baseline bugs recorded
  • Automated regression tests added/updated, with scope and limits listed above

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Intended differences from the common pattern: the approved combined row/terminal-button interaction, plain-list exclusions, supported-host restrictions, and Create/default fallback policy remain. No new saved setting or wire operation is added.

  • Temporary boundary: creation still materializes through renderer adapters rather than one host launch request; the launch-unification work and A launch can name chat or terminal: agent.launch gets a surface pick and the CLI gets --surface chat|terminal #31191 own that convergence.

  • SSH and paired servers: the rows are answered by the host the new workspace will run on (SSH, paired server, WSL), the same way the "+" menu answers for an existing workspace. Nothing new is sent over the wire.

  • Ephemeral VM creates: these keep today's plain list, because that host isn't known until creation.

  • Platforms: no platform-specific code.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots attached for UI changes
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Current-head full PR workflow green, including the aggregate gate

…CLI per agent, like the "+" menu

The Create worktree, Create folder and session-continuation agent pickers now
list the same rows as the tab bar "+" menu: chat agents first, each with a
terminal button that picks the agent's CLI instead, then the agents that only
run in a terminal, labelled "(CLI)". A terminal pick shows as "Claude (CLI)"
and starts the agent in a terminal even when chats are the default.
A continuation into a subfolder shows chat as unavailable there.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 20, 2026 18:48
@coderabbitai

coderabbitai Bot commented Oct 20, 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: 7d2a7fb2-76a9-4627-961a-131fd28092a0
📥 Commits

Reviewing files that changed from the base of the PR and between 9d5696f and 98c7fca.

📒 Files selected for processing: 2
  • src/renderer/src/components/tab-bar/QuickLaunchButton.launch-status.test.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts

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

📝 Walkthrough

The changes add shared chat and terminal surface selection to agent menus. Menu observation resolves readiness, host availability, and launch routes for workspace targets. The quick composer and continuation dialog retain the selected surface and pass the resulting launch choice through submission and session-launch paths. The agent picker now supports surface-specific rows, terminal actions, keyboard handling, and unavailable-chat states. Tests cover menu hydration, picker interactions, composer submission, and continuation routing.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 98c7f

Users selecting chat may unexpectedly receive a terminal session; fix the route selection before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.81% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 33 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the primary change: chat and CLI choices in the Create worktree, Create folder, and continuation pickers.
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.
Description check Passed The pull request description is complete and follows the repository template. It explains the user-visible change, implementation, rationale, scope, linked follow-up work, visual proof, testing covera…
Full details: Description check

Explanation

The pull request description is complete and follows the repository template. It explains the user-visible change, implementation, rationale, scope, linked follow-up work, visual proof, testing coverage and limits, platform considerations, and checklist status. The maintainer-specific Linked Issue and AI Disclosure exceptions are addressed by the provided context.

✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0ae91e6-17fc-455c-8e08-6b097631d005
📥 Commits

Reviewing files that changed from the base of the PR and between 3803416 and e2eae41.

📒 Files selected for processing: 31
  • src/renderer/src/components/NewWorkspaceComposerModal.agent-surface.test.tsx
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx
  • src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx
  • src/renderer/src/components/agent/AgentCombobox.surface.test.tsx
  • src/renderer/src/components/agent/AgentCombobox.tsx
  • src/renderer/src/components/agent/AgentTerminalLaunchButton.tsx
  • src/renderer/src/components/agent/agent-combobox-items.tsx
  • src/renderer/src/components/agent/agent-combobox-surface-items.tsx
  • src/renderer/src/components/new-workspace/NewWorkspaceComposerAgentSection.tsx
  • src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit-surface.test.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/tab-agent-row-presentation.ts
  • src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts
  • src/renderer/src/hooks/composer-state/composer-agent-rows-target.ts
  • src/renderer/src/hooks/composer-state/composer-card-contract.ts
  • src/renderer/src/hooks/composer-state/composer-card-props.ts
  • src/renderer/src/hooks/composer-state/composer-submit-model.ts
  • src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts
  • src/renderer/src/hooks/composer-state/quick-creation-execution.test.ts
  • src/renderer/src/hooks/composer-state/quick-creation-execution.ts
  • src/renderer/src/hooks/composer-state/quick-creation-request.ts
  • src/renderer/src/hooks/composer-state/quick-submit-action.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/agent-menu-selection.ts
  • src/renderer/src/lib/agent-session-launch-plan.ts
  • src/renderer/src/lib/launch-agent-session-continuation.test.ts
  • src/renderer/src/lib/launch-agent-session-continuation.ts
  • src/renderer/src/lib/new-tab-agent-menu-rows.ts

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

@brennanb2025

brennanb2025 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Create worktree, Create folder and continuation previously left the chat/terminal choice to global settings. This PR gives them the plus menu's chat row and terminal button, and carries the displayed choice through launch preparation.

The full review loop is complete on 98c7fca1628f302f9b3ea9831885f6aa07d10e25 (3 rounds). Fixed: stale keyboard terminal arming, lost exact-search ranking, submission before selected-agent readiness, explicit continuation chat silently falling back, displayed CLI versus submitted chat disagreement, and unresolved existing-workspace ownership detecting forever. The last case now settles with no runnable agents and recovers on owner hydration, without using another host's inventory. The final main merge preserves both picker observation and main's keyboard router. A subsequent two-file test-fixture repair changes no production code. The final automatic-review concern about a CLI-default agent offering a chat row was refuted from the row builder's preference filter; its thread is resolved.

The exact-head full PR workflow passed, including the aggregate gate, static analysis/typecheck, five test shards, relay integration and Linux/Windows packaging. Targeted merge checks passed 10 files / 43 tests; the test-only repair passed 3 files / 16 tests with commit hooks. Final independent readiness, dedicated performance coverage and whole-mechanism comparison found no new proven defect; counsel was skipped as requested. The PR is out of draft, conflict-free, and review threads are resolved.

Real Electron QA compared exact branch 98c7fca1628f302f9b3ea9831885f6aa07d10e25 with main 582efa79897f8bcd47581a270dabbace51122f39 on M4Air, using hidden Chrome DevTools Protocol (CDP) control. Codex drove the app through qa-drive; real Claude Code 2.1.306 and Codex 0.163.0 ran under isolated homes through the load balancers. Both agent connectivity checks and real replies passed. Ticket #1084 is released and all owned test processes are stopped.

Create worktree, Create folder and root continuation each completed chat and terminal launches with real replies on both heads. Continuations carried the original context and retained the source/group; the untouched default also delivered context and replied. Worktree setup/default tabs ran and all six setup markers completed. The branch exercised the terminal button, (CLI) label, ArrowRight then Enter, selected-button reopening, cancellation/dismissal reset, and plain mode. A real unresolved-owner dialog settled with no runnable agents and recovered when its owner was restored, without borrowing another host's inventory.

Two existing bugs reproduced on both exact heads: Setup can take selection/focus from the new chat (STA-10869), and subfolder continuation starts the destination agent at the workspace root (STA-8416). The bounded focus order was branch Setup then Chat, main Chat then Setup; it establishes baseline occurrence, not relative failure frequency. Actual first destination Bash pwd confirmed the cwd failure on both heads. Evidence was added to the existing tickets; neither is labelled intended behavior or fixed here. No PR-exclusive defect was established.

Intended differences from the common pattern: the approved combined row/terminal-button UI, plain-list exclusions, supported-host restrictions, and Create/default fallback versus explicit-continuation refusal. Temporary difference: renderer creation materialization remains assigned to launch-unification and #31191. No new saved setting, wire operation or user default is introduced.

Deferred/limits: no natural live provider decline; asynchronous route stability and refusal policy are source/test coverage. Remote/SSH/WSL, mobile, Windows/Linux and assistive behavior were not rendered in this macOS lane. Folder YAML setup/default tabs were absent on both heads. No speculative concern earned a new review round.

For Brennan's review: current-head comparisons below. The three judgment points are selected readiness and effective route, unresolved-owner empty settlement and hydration recovery, and continuation captures the choice before detection.

Flow Branch Main
Create worktree: Codex chat; branch repeat / main first Branch Create worktree: Codex chat; branch repeat / main first Main Create worktree: Codex chat; branch repeat / main first
Create worktree: Claude terminal reply Branch Create worktree: Claude terminal reply Main Create worktree: Claude terminal reply
Create folder: Claude chat reply Branch Create folder: Claude chat reply Main Create folder: Claude chat reply
Create folder: Codex terminal reply Branch Create folder: Codex terminal reply Main Create folder: Codex terminal reply
Root continuation: Claude chat reply Branch Root continuation: Claude chat reply Main Root continuation: Claude chat reply
Root continuation: Claude terminal context/reply Branch Root continuation: Claude terminal context/reply Main Root continuation: Claude terminal context/reply
Existing Setup focus race; branch first / main repeat Branch Existing Setup focus race; branch first / main repeat Main Existing Setup focus race; branch first / main repeat
Existing subfolder continuation: destination pwd is root Branch Existing subfolder continuation: destination pwd is root Main Existing subfolder continuation: destination pwd is root
Committed CLI choice on reopen Unresolved owner: empty, disabled Owner restored: normal picker
CLI button remains selected No runnable agents for unresolved owner Owner hydration recovers agents

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54798748-4f7d-439e-ae74-1079a6e8c973
📥 Commits

Reviewing files that changed from the base of the PR and between 3a64273 and 9d5696f.

📒 Files selected for processing: 2
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.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.

@brennanb2025
brennanb2025 merged commit 899ed41 into main Oct 21, 2026
33 checks passed
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