Skip to content

Use the shared agent picker in workspace and Source Control launches - #35802

Merged
brennanb2025 merged 120 commits into
mainfrom
brennanb2025/agent-picker-everywhere
Nov 3, 2026
Merged

brennanb2025 merged 120 commits into
mainfrom
brennanb2025/agent-picker-everywhere

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 78 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12608 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1233 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11375
Prod 147 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6124 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1767 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4357

Workspace creation, continuation and Source Control offered separate agent controls with different setup capabilities. This PR brings new git and folder workspaces, continuation, saved Source Control recipes and Customize onto the same native hover-submenu picker used by the + tab. Each live target keeps its whole setup draft. Applying setup preserves the current command template; saved recipes retain the fields the user authored.

Model, effort, permission, Fast and Arguments share the same controls and removable chips. Source Control model labels use that same projection, including models pinned in the action’s own Arguments. Chat receives the complete selected chat settings. Terminal startup and fallback retain the matching Arguments and Terminal settings. Invalid requested Terminal Arguments stop workspace creation through the existing error surface.

Model discovery now works before the first chat is opened. The picker discovers models before a chat exists and shares that catalog with later chats. Known or retained model rows stay usable when discovery is unavailable; a failed or unsupported read shows guidance only when there are no usable rows. Closing and reopening the whole picker retries eligible reads. Fresh-profile model and effort search in the + menu is tracked in STA-13228.

Mounted labels refresh when language changes while preserving staged edits. Unrelated settings and other-host updates avoid reanalyzing unchanged closed recipe pickers. The desktop sandbox bridge and independent mobile install include the parser they consume. The full Automation picker remains a follow-up; this PR changes no Automation editor, executor, saved field or wire contract. Configured paired/remote workspace creation remains disabled, tracked in #31255.

Saved Source Control actions launch the Chat or Terminal surface selected in the action. Agents Settings supplies the initial selection when setting an agent in the editor; changing that selection and saving it takes precedence at launch. Recipes without a saved surface continue to follow Settings. Existing fallback applies when the host cannot run Chat.

The + tab setup panel retains the optional first-prompt composer; its Launch chat / Launch terminal buttons launch immediately. In new workspace, continuation and recipe forms, those named buttons apply the setup and select Chat or Terminal; the outer Create, Start or Save performs the action. Forms keep their existing prompt or template, and recipes do not save a first prompt. Setup choices survive a defaults refresh; untouched values follow current defaults. In Source Control, saving only a permission choice leaves Arguments inherited, so Configure reopens with the latest default Arguments enabled.

Only the Create worktree menu matches its Agent field. Settings, folder workspaces, project groups, continuation, Customize and the + tab retain compact menus. Native hover and keyboard setup navigation is integrated across these affected entry points, with submit icons, equal-width surface buttons and one highlighted row. The shorter list retains its Agent settings footer. In forms, Agent settings opens the existing Agents dialog while retaining the pending form; New Workspace shares the dialog with its gear button. The + tab keeps its existing Agents page action. Selected model captions keep their canonical metadata spelling, or the literal ID for an unknown model, across opening, catalog updates and closing. A deliberate named Chat or Terminal choice is saved even when it matches the current Settings route; browsing or reopening alone does not write a choice.

The setup panel keeps its 416px width within the viewport, including when it overlaps the agent menu. Closing Agents returns keyboard focus to the live picker or gear button, preserving the form and pending Arguments. Native submenu navigation and the existing dialog ownership remain in place.

Blank Terminal intentionally creates only the setup terminal for a git workspace when setup is configured, without launching an agent or adding default tabs or an extra shell beside setup. Folder workspaces and git workspaces without setup retain their existing terminal defaults.

Current verification: the independently reviewed repair is 1287bf382f87e09d0500d4ddbda0ebdd375a372c. The targeted M4Air app check measured a 416px setup at 1710×1073, 1000×700 and the supported 600×400 minimum. Create worktree’s Agent field and menu both measured 446px at 1000×700. At 600×400, one normal scroll exposed both launch buttons within the panel; their hit targets were verified. Resizing retained pending Arguments. Closing Agents returned focus to the live picker, then Tab reached Advanced; the gear returned to the gear. Representative Customize and recipe-editor returns retained their pending edits and live picker focus.

The targeted app checks covered only the changed layout, focus and interaction. At 600×400, ordinary hover opened the overlapping native setup. A delivered click reached the foreground Search models input; one ArrowLeft returned to the live row, one ArrowRight reopened the same setup with pending Arguments retained, and one Escape returned to its Configure button. The exposed Agent settings footer remained usable and the form draft stayed intact. The covered underlying chevron was not treated as a click-through target; no physical segment press or prolonged stationary-pointer result is claimed.

The separate searched-result setup retains its click-to-open contract. Its ordinary 416px opening was verified, and a supported split layout exercised the constrained fallback: the actual trigger had 299px to its left and 265px to its right after the 6px gap, both below 416px. An ordinary Configure click produced a 416px panel within the 600×700 viewport, placed above the trigger with empty Search models focused. The existing standalone collision policy permits contact with the viewport edge. Fixture preparation and an incorrectly scoped initial locator were corrected before the completed observation; these are not claimed as product failures. No new image, provider reply, workspace creation or previously passed flow was repeated.

Current Create worktree: matching field and menu, 416px setup

Captured at 1287bf3; the reviewed main merge 757b1bab987dbbcd32401a38906adb63489b812b conserves the repair, and d47a45e7d3208f04bf9278b0a79244ed7dd621f0 changes two test-support files only. CI on that final head is green: 57 successful checks, 18 skipped. The merge retains both sides’ test assertions; eight named affected files passed 91/91 in one execution. The subsequent two-file test correction passed 30/30 with production unchanged. These are separate, overlapping receipts, not a combined total.

Current production contribution against pinned main 6d5edf8c3350cfb8b5e35f6aecea8a1f8a8ef9bf is 4,505 additions after subtracting only the original surviving 110-line move credit from 4,615 whitespace-normalized additions. The governing 4,532 tripwire is unchanged; incoming-main changes are not branch growth.

For source review: native setup placement, Agents focus return, and saved-action dispatch.

The final independently reviewed source is d47a45e7d3208f04bf9278b0a79244ed7dd621f0. It includes main merge 10681abda330ee2e5c593cec5aa4876e4a7cbde4 for #37576 and a0b492d1090d0e1d826b4a2521035d329e5ffce2 for #37675, the width/focus repair 1287bf3, main merge 757b1ba from pinned main 6d5edf8, and test-only correction d47a45e. The narrow union reviews preserve incoming native submenus, submit icons and single-highlight behavior together with this PR’s form selection, saved choices, pending Arguments and launch ownership.

QA4114’s setup-only Blank Terminal leg passed on a8616ad7a8320904625b95bb474c33a4b078a83e: Blank Terminal → outer Create → actual setup approval and completion produced only the Setup tab, a printed completion and returned prompt, the exact setup marker, no unwanted default-tab sentinel and one workspace PTY. No agent was launched. This leg was not repeated in stage2; folder and no-setup terminal defaults were separate, unexercised contracts. The later reviewed changes carry this unchanged provisioning result, not new native-menu pixels.

QA4114 stage2 ran the app built from 8950067ed497e376f47275fb08fe56560d8a644e; test-only 3f87935304dcd53995ba5794bd22e85d4daef103 preserved production/build/configuration bytes. Observed caption authoring and reopen, actual Agents destinations, retained drafts, nested submit-chord suppression and representative German UI passed their recorded assertions. This was not a full pass: at 1000×700 Create worktree’s field and menu measured 446px but setup compressed to 276px; after closing nested Agents, focus was BODY even though subsequent controls worked. Normal 1710px-wide setup measured 416px. The subsequent repair and current measurements are described above; this historical run remains recorded as the original failure.

The same QA distinguished nested return from ending the form: Customize retained pending Configure Arguments, prompt and save target across Agents return; there is no separate outer Arguments field, and canceling the whole Customize form discards its unsaved draft. At 1000×300 the menu scrolled and End focused the footer, but its bottom extended below the capture and the footer was not visible; that diagnostic height is below the native 400px minimum and is not a viewport-fit pass. Natural catalog-pending timing and the strict already-explicit-agent/no-saved-surface repository variant were not observed live; accepted deterministic caption/writer/saved-start tests cover those contracts without synthetic app fixtures. The old screenshots are not proof of the later native-menu UI.

The text-generation picker work in #37205 remains a separately owned follow-up that depends on this base; it is not claimed as shipped here. Full Automation setup remains separate.

Targeted integration QA4047 passed on 2e8487ba10628735714405ca081038de06c4ab8f: permission-only Source Control Save → Claude default Arguments refresh → Configure reopened with enabled --debug and retained permission, followed by four first-prompt launches with Claude and Codex in Chat and Terminal. Each opened one tab, delivered its first prompt once and returned a real reply. The 416px layout, launch buttons, terminal-only hint, compact permissions, enabled model list, wrapping Arguments, chips, hover behavior and complete draft retention were checked. Claude Terminal needed one genuine first-run permission acceptance; terminal reply text was checked in full-window canvas screenshots.

Validation: focused regression cases cover explicit saved Chat and Terminal against opposite Agents preferences, editor preselection, and recipes without a saved surface. Native Windows argument cases, ordinary desktop build/preload/boot, the independent mobile dependency graph, real Claude/Codex launches and whole-window screenshots retain their recorded scope. Historical suite totals overlap and are not combined. Targeted saved-action QA on 9b83104 verified Terminal preselection under CLI preference, deliberately saved Chat, reopen with Chat retained, and actual Claude and Codex AI Fix chats with real replies reporting the scratch-file repair. The setup-only driver stop is excluded.

Fresh-profile validation on e34fa01 showed Pi's model list in the + tab and New Workspace before any chat or Session History had been opened. The native Pi probe returned 42 models, including 7 OpenAI models. New Workspace followed catalog loading in the + tab. Pi, Claude and Codex each returned a real reply from New Workspace with the selected model confirmed in their own session records. Pi's catalog included two models this account rejected; those were separate failed attempts before the successful GPT-5.6 Sol run. The three Pi attempts each used one Create and one Send; no duplicate launch from one action was observed. The first launch's missing rig model variable is excluded from product results. Pending-state behavior is covered by deterministic tests and was not observed live.

Claude Fast-on not exercised: the QA sign-ins (team load balancer) run at Standard speed; the launch passes fastMode:true and the correct argv (QA3768).

Historical visual proof: each launch surface

These captures are historical and retain only their stated evidence for unchanged flows. They are not current native-menu, repaired-placement or restored-focus screenshots. The separate Blank Terminal result and older caption/draft observations are described above; the current representative screenshot and focus measurements appear above.

Historical main baseline is01e03f99209aa3d3fe3de3d9979c26944eeb1da2. English branch captures are from the admitted c4b6/da0 runs; later test-only commits and the reviewed main integration retain their qualified layout evidence. Different configured choices illustrate the available controls; these are not identical-input execution comparisons. The Claude Fast disclosure above still applies. These captures precede the saved-surface change; the separate targeted captures below cover its new editor and launch behavior.

Surface Historical main Branch
New git workspace New git workspace on historical main New git workspace on branch
New folder workspace New folder workspace on historical main New folder workspace on branch
Continuation Continuation on historical main Continuation on branch
Global Source Control recipe Global Source Control recipe on historical main Global Source Control recipe on branch
Repository Source Control recipe Repository Source Control recipe on historical main Repository Source Control recipe on branch
Customize Customize on historical main Customize on branch
Common + tab Common + tab on historical main Common + tab on branch

Retained earlier branch Spanish layout captures, covering the common translated panel and Customize:

Spanish branch-es-customize

Spanish branch-es-repo-common-panel

Saved Source Control Chat with Agents set to CLI

Actual QA head9b83104a; independently reviewed main merge083f87a carries this unchanged flow. Each agent stayed set to CLI in Agents Settings. The editor initially selected Terminal; the deliberate Chat choice survived Save and reopen, and the saved AI Fix action opened a real Chat with a response reporting the requested scratch-file repair. The Codex result image shows the final reply; its initial marker was separately correlated to the same provider session.

Agent Initial selection Saved and reopened Actual Chat result
Claude Claude cli-pref-claude-editor-preselection.png Claude claude-saved-chat-reopen.png Claude claude-saved-chat-result.png
Codex Codex cli-pref-codex-editor-preselection.png Codex codex-saved-chat-reopen.png Codex codex-saved-chat-result.png
Fresh-profile catalog and New Workspace replies

Actual QA head e34fa01. The + tab image shows the populated Pi model list before any chat existed. The New Workspace image shows the accepted GPT-5.6 Sol Chat selection; its populated model list is recorded in the driver snapshots. Reply images show the three agents' real responses. Agent session records, rather than self-reported model names in replies, establish the models used.

pi-plus-catalog.png
pi-new-workspace-gpt56sol.png
pi-reply.png
claude-new-entry-reply.png
codex-new-entry-reply.png

Fresh-profile search QA3943 on 7b8736a587e29bd8a1a67610e62c598ae489be4e passed the accepted row-and-launch scope, tracked in STA-13228. Before any chat or Session History was opened, opus high showed Claude · Opus · High and gpt high showed the Codex model/effort rows. Selecting the Codex GPT-6.1-Sol High row opened Terminal; process argv confirmed -m gpt-6.1-sol -c model_reasoning_effort=high. The original attempt sent no prompt and obtained no reply; it proves search and the chosen launch model/effort only. Earlier Codex Terminal QA covers a real reply, and the launcher accepted this scope without another run. Compact Codex labels are ellipsized in the image; complete model and High labels were verified through accessible names.

Fresh-profile model and effort search (QA3943)

Original cold-search captures at 7b8736a, before any chat or separate picker warmup. These show search results; they do not show a reply. The launch argv was verified separately as described above.

Fresh-profile Claude Opus High search
Fresh-profile Codex model and High search

Codex Speed was left unset in this run, so its terminal used its own default and displayed Fast. The selected model and effort and the real reply were observed; no spawned argv was archived for that Codex leg. This adds no explicit Fast-on verification.

Historical qualified integration: Source Control refresh and first-prompt launches (QA4047)

Captured on 2e8487ba10628735714405ca081038de06c4ab8f on M4Air with a Codex driver through qa-drive. A permission-only Source Control edit was saved without Arguments of its own; after changing Claude’s default Arguments to --debug, reopening the same recipe showed enabled Arguments and retained Accept edits.

Source Control: current default Arguments enabled after permission-only Save

Source Control common permissions dropdown

The + tab setup panel measured 416 CSS pixels and kept both launch buttons, the terminal-only hint, compact permissions, enabled model rows, wrapping Arguments and model/effort chips. The first Claude prompt and all choices survived closing and reopening. Each launch below delivered its setup prompt once and produced a real reply, without a manual re-send. The terminal setup captures show the previous explicit choice before the driver changed effort for the new launch; replies show the final Low choice.

Claude chat: common setup panel

Claude chat: real reply to the setup first prompt

Claude terminal: common setup panel

Claude terminal: real reply to the setup first prompt

Codex chat: common setup panel

Codex chat: real reply to the setup first prompt

Codex terminal: common setup panel

Codex terminal: real reply to the setup first prompt

First prompt and complete setup retained after reopening

Common compact permissions dropdown

Claude Terminal required one genuine first-run permission acceptance; it was not an extra prompt send. Terminal replies were verified in the rendered canvas screenshots. No other previously passed flow was rerun.

# Conflicts:
#	src/renderer/src/lib/worktree-creation-host-agent-launch.test.ts
#	src/renderer/src/lib/worktree-creation-structured-session-host-decline.test.ts
#	src/renderer/src/lib/worktree-creation-structured-session.test.ts
…cker-everywhere

# Conflicts:
#	config/scripts/typecheck-project-coverage.test.mjs
#	config/tsconfig.tc.web.json
#	config/tsconfig.test.pane-launch.json
#	config/tsconfig.web.json
…cker-everywhere

# Conflicts:
#	src/renderer/src/components/agent/AgentLaunchSetupPanel.prompt.test.tsx
#	src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Create worktree on 90bd218682a.

The closed agent field reads Claude (CLI). The menu puts the terminal icon on the left of Blank Terminal. Setup only is the row under it.

Create worktree closed field

Create worktree agent menu

@brennanb2025

brennanb2025 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Current Create worktree at 1000×700: the menu matches the 446px Agent field, and Configure stays 416px wide with pending Arguments retained. Native submenu navigation, compact permissions, removable chips and both named surface buttons remain visible. Captured on 1287bf382f87e09d0500d4ddbda0ebdd375a372c; the reviewed main merge 757b1bab987dbbcd32401a38906adb63489b812b and test-only d47a45e7d3208f04bf9278b0a79244ed7dd621f0 carry this layout evidence. The separate targeted interaction checks also verified a delivered foreground click, single-key return to the parent and its usable footer, and the standalone 416px fallback when both lateral spaces were too small. Those checks used this same build; this image illustrates the layout rather than the interaction sequence. Earlier provider and workspace-result evidence retains its original scope.

Create worktree with matched menu and 416px setup

@brennanb2025
brennanb2025 merged commit ed54ecf into main Nov 3, 2026
75 checks passed
nwparker added a commit that referenced this pull request Nov 5, 2026
… picker (#38680)

* fix(new-workspace): restore right-click "Set as default" on the agent picker

The shared agent picker (#35802) replaced the combobox in the new-workspace
composer and dropped the context menu that set the default agent. Wire
defaultAgent/onSetDefault through AgentLaunchPicker so agent rows, the
Blank Terminal row, and the closed field offer it again.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(agents): keep the "Set as default" menu open when the mouse moves

The context menu was non-modal, so hovering the agent rows beneath it
moved focus to them and dismissed the menu. Make it modal so focus stays
in the menu until the user picks or dismisses.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(agents): keep the row highlighted while its "Set as default" menu is open

Row highlight follows focus, which moves into the context menu. Mark the
trigger with data-context-menu-open and style it like the hovered row.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(agents): address review on the Set as default context menu

- Keep the context menu non-modal; prevent focus-outside dismissal instead,
  so combobox callers keep one-click selection and scrolling.
- Drop the field-level context menu: it clobbered the dropdown trigger's
  data-state/data-slot, ignored the disabled gate, and doubled up on long-press.
- Pass onSetDefault through unchanged so memoized rows stay stable.
- Reset the open marker when the menu unmounts while open.
- Stop asserting the CSS-only highlight marker in tests.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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