Skip to content

feat(coding-agent): select provider before model - #2288

Closed
gurssagar wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
gurssagar:feat/2287-provider-first-model-picker
Closed

feat(coding-agent): select provider before model#2288
gurssagar wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
gurssagar:feat/2287-provider-first-model-picker

Conversation

@gurssagar

@gurssagar gurssagar commented Sep 13, 2026

Copy link
Copy Markdown

Fixes #2287

Summary

Change plain /model from a flat catalog to provider → model selection. Users can choose their provider first, then search a shorter list containing only that provider's models. Keep /model <query> as the direct-search shortcut.

This PR contains only the picker feature. Fast-mode capability and daemon metadata changes are tracked separately in #2286.

User flow

  1. Open /model with no query. See Choose provider and Search providers.
  2. Search by provider ID or display name. Each represented provider appears once, with a model count, configured-auth status, and current-provider marker when applicable.
  3. Confirm a provider. This only opens its model list; it does not switch models or trigger authentication.
  4. Search that provider's models, optionally adjust supported reasoning effort, then confirm the model using the existing selection/authentication flow.
  5. Press Escape to return to providers. Restore the previous provider filter and highlighted provider when present. Press Escape again to close.

/model <query> still starts directly in cross-provider model search within the active all/scoped selection. Its first Escape also returns to providers; the next closes. The model query is cleared when entering a provider again.

Implementation

Provider grouping, ordering, and search

  • Add local providers | models navigation state to ModelSelectorComponent. Derive providers from the existing model catalog and active scope; add no new provider endpoint.
  • Resolve display names using built-in names, OAuth names, then raw provider IDs.
  • Deduplicate providers and retain existing authentication-aware model-sort priority, including signed-in Prime Inference priority. Preselect the current provider/model when present.
  • Filter provider names/IDs with normalized fuzzy matching. Retain provider priority order rather than sorting provider rows by fuzzy score.
  • Restrict model results to the chosen provider while preserving existing exact-ID, prefix/token, fuzzy, current/recent, and auth-aware search ranking.
  • Retain unauthenticated catalog entries. “Signed in” means configured authentication, not a verified live request.

State, keyboard controls, and layout

  • Preserve the current stage, provider restriction, query, and selected item across catalog/auth refreshes when the item remains available. Clamp selection safely when it disappears.
  • Continue avoiding local registry refresh when models are injected by the caller.
  • Apply all/scoped filtering at both stages. Preserve scoped model order within a provider without a query. Switching scope can leave an empty provider-specific model list; back or another scope change remains available.
  • Replace the search input on stage changes while retaining focus and using the correct placeholder/submit handler.
  • Keep configurable navigation, paging, confirmation, cancellation, scope, and cursor controls. Left-at-search-start retains back behavior; supported effort editing takes precedence with an empty model query.
  • Edit effort only on model rows. Pass an effort override only after an explicit edit; untouched effort retains normal model-switch restoration.
  • Update ConfigurationMenuComponent footer hints via isSelectingProvider(): navigation/close at the provider stage, model/effort/back at the model stage.
  • Reserve rows for the stage heading and hide model-only details in provider/empty results. Preserve narrow/short viewport behavior, scroll indicators, price details, and effort alignment.
  • Update seven test files and add a coding-agent changelog fragment.

Compatibility and scope

No daemon wire changes. This PR adds no commands, events, capabilities, schema fields, or protocol/schema version changes. It uses existing catalog and configured-provider metadata and preserves the model-selection callback contract.

This does not redesign /login, merge configuration tabs, alter provider inference code, or change the model catalog. Model-selection completion, busy-state protection, login cancellation, effort retry, and editor draft/focus retention remain covered.

The additional provider confirmation and back-then-close behavior are intentional interaction changes, including when entering through direct model search.

Validation

  • Isolated picker-only branch: npm run check passed (format/lint/types, installer, browser smoke; 1,035 files checked, no fixes).
  • 231 tests passed across all seven changed test files: model-selector actions (30), configuration menu (13), interactive-mode status (169), search reset (4), feat(ui): make configuration pickers compact and inline #2182 selection (6), #3217 scope ordering (2), and #4575 auth selection (7).
  • git diff --check passed. Validation made no formatter or implementation changes.

Run from packages/coding-agent:

npx tsx ../../node_modules/vitest/dist/cli.js --run test/configuration-menu.test.ts test/model-selector-actions.test.ts test/interactive-mode-status.test.ts test/selector-search-reset.test.ts test/suite/regressions/2182-picker-selection.test.ts test/suite/regressions/3217-scoped-model-order.test.ts test/suite/regressions/4575-model-auth-selection.test.ts

Coverage includes grouping/search, provider-restricted callbacks, current selection, direct search, back/close, refresh/empty states, scopes, authentication ordering and fallback, effort/search interaction, failure/retry, draft/focus retention, paging, and viewport limits. The total includes existing regressions, not only newly added tests.

Supplementary earlier installed-component smoke passed both stages, scrolling, and back navigation at 24/80/120 columns × 8/12/24 rows, using fake models/auth and blocked network access. It loaded the installed selector from an isolated unpublished build that also included the separate Fast change. The isolated PR-branch validation above is the feature-only check; the installed smoke is not authenticated end-to-end inference validation.

No real credentials were copied or authenticated inference calls made. Account availability, live login, and provider acceptance remain outside these mock tests.

Note

Add provider-first selection to ModelSelectorComponent picker

  • Refactors the model picker into two stages: a provider list (searchable by ID or display name, with model counts and auth status) followed by a provider-scoped model list. Escape returns to the provider list before closing.
  • Direct model search via /model <query> still opens straight in model mode and searches across providers.
  • Updates configuration-menu.ts footer to label Escape as "close" during provider selection and "back" during model browsing.
  • Updates all existing selector, configuration-menu, status, search-reset, and regression tests to drive through the provider stage before asserting model behavior.
  • Behavioral Change: every model selection flow now requires an extra provider-confirmation step; cancellation needs two Escape presses (back to providers, then close).

Macroscope summarized de661db.

@github-actions

Copy link
Copy Markdown

Prime Agent performance — pending-trust

PR de661db3 compared with main 878410b3.

Waiting for contributor vouch before credentials or sandboxes are allocated.

Run, logs, and downloadable raw results

@github-actions

Copy link
Copy Markdown

Hi @gurssagar, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Sep 13, 2026
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.

Make the model picker provider-first

1 participant