Skip to content

feat(acp): add provider config picker for sessions#869

Merged
matt2e merged 34 commits into
mainfrom
model-picker
Jul 8, 2026
Merged

feat(acp): add provider config picker for sessions#869
matt2e merged 34 commits into
mainfrom
model-picker

Conversation

@matt2e

@matt2e matt2e commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a model/effort config picker for ACP providers, letting users choose a provider configuration when launching a session and adjust it on follow-up prompts.

  • Discover available config selectors (model, effort) from ACP providers via a discovery session, with per-provider caching and auth-required providers skipped gracefully
  • New column-based picker UI (AcpConfigPicker, AcpConfigPickerShell, AcpFixedConfigPicker) with full keyboard navigation, used in the new-session modal and chat follow-up controls
  • Persist the selected config per session (new acp_config_selection column, migration 0020) and apply it before prompting, including on session resume
  • Normalize config options in acp-client and thread the selection through session launch, queueing, and the web server
  • Extract shared launcher helpers and resolve-related support in doctor

Test plan

  • cargo test covers config normalization, selection persistence, store migrations, and session command regressions
  • Vitest covers picker keyboard handling, config selection state, and config metadata mapping
  • Pre-push checks (fmt, clippy, svelte-check, full test suite) pass

🤖 Generated with Claude Code

@matt2e
matt2e requested review from baxen and wesbillman as code owners July 8, 2026 05:17
matt2e added 9 commits July 8, 2026 15:19
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Remove the unused provider-only AgentSelector and add regression coverage for launch payloads, queued-session drain selection handoff, resume payloads, stale value fallback, and unavailable selector fallback.

Signed-off-by: Matt Toohey <contact@matttoohey.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b84afdafd6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1619 to +1620
let discovery = fresh_cached_acp_config_discovery(session.provider.as_deref()).or_else(|| {
latest_acp_config_discovery_from_session_metadata(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve model-specific effort selections

When resuming without an explicit selection (for example queued follow-ups or the timeline Resume action), this checks the provider-wide discovery cache before the session's own config metadata. That cache is populated by the initial/default-model picker discovery and is not keyed by the stored model, so a session saved with model=opus plus an effort value that only appears after switching to Opus can have its effort sanitized against the default model's options, dropped, and then persisted as a truncated selection. Prefer the session metadata or a model-specific discovery when the stored selection includes a model.

Useful? React with 👍 / 👎.

matt2e added 18 commits July 8, 2026 15:25
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Selecting a provider dismissed the whole picker dropdown, so the model
and effort columns for the new provider could never be reached. Mark the
provider, model, and effort radio items closeOnSelect={false} so the
popover behaves like a settings panel, and clear the stale discovery
config when a new discovery starts so the now-visible columns show the
loading state instead of the previous provider's options.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
The trigger button showed provider · model · effort, which overflowed
and hid the values that actually change. The provider icon already
identifies the provider, so remove its text from the trigger label in
both pickers, fall back to the provider name only while no model or
effort labels are available, and surface the provider name in the
trigger's hover title instead.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Style the fixed model and effort picker like the new-session dialog control and place it before the attachment button in the existing-session composer.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Close the existing-session model and effort picker when Return is pressed after the focused option has handled selection.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Make up and down arrow navigation activate picker values immediately, and make Return dismiss the picker without selecting the focused item.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
matt2e and others added 4 commits July 8, 2026 15:27
Changing the model made the effort column blink through a spinner row
even though the refreshed options are usually the same, and the trigger
button swapped its chevron for a spinner on every reload. Retain the
previous effort selector and render it as muted disabled options while
the model-specific options load, replacing the retained-width
placeholder, and only show the trigger spinner before any model or
effort content is available.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
The trigger label values fly in and out on change but the button width
snapped to the new content size. Render a hidden max-content sizer copy
of the trigger parts, observe its size, and set an explicit transitioned
width on the visible label so the button eases between content widths.
Flex shrink still applies to the explicit width, so tight rows truncate
exactly as before. Also deduplicate the trigger label markup between the
dropdown and static button branches with a shared snippet.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
matt2e and others added 3 commits July 8, 2026 16:41
Address the code review feedback on the config picker series:

- Export is_config_selection_unavailable_error from acp-client, built
  on the same string constants the driver's error producers use, and
  drop the app-side substring copy so rewording an error message can't
  silently disable the stale-selection cleanup.
- Persist the resume config selection before spawning the session run
  in both the Tauri command and web server resume paths, so an instant
  unavailable-config failure can't have its selection cleanup
  overwritten by a late re-persist of the stale value.
- Stop failing resumed prompts when an agent that advertised config
  options on session/new omits them from session/load. The selection
  was applied when the session was created and lives in the agent's
  session state, so skip the re-apply with a warning instead of
  erroring the first follow-up after an app restart.
- Keep the effort column usable when model-specific discovery fails:
  the new-session picker restores the previous model's effort options
  and the follow-up composer falls back to the non-model-specific
  options, instead of the column disappearing until the provider or
  working directory changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Typing in a composer next to the config picker made the trigger's icon
and border shimmer. The app's 13px rem base gives the trigger
fractional-pixel geometry, and partial repaints of the surrounding
layer re-rasterize those between-device-pixel edges with slightly
different anti-aliasing each pass. Promote the trigger to its own
compositing layer with translateZ(0) so it only re-rasterizes when its
own content changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Compact panes are too narrow to fit the config picker, attach button,
text input, and send button in a single composer row. Let the compact
input area wrap, order the hashtag input first as its own full-width
row, and push the send/stop button to the right edge of the controls
row beneath it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e merged commit b186ced into main Jul 8, 2026
5 checks passed
@matt2e
matt2e deleted the model-picker branch July 8, 2026 07:44
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