Skip to content

v0.8.65: Cross-provider /model search using explicit route rows #3075

Description

@Hmbown

Goal

Make /model searchable across providers without reintroducing ambiguous naked model selection.

This issue owns the cross-provider search UX. #3383 owns provider-scoped model candidates. Both surfaces must return explicit provider-scoped references and apply selections through #3384.

Architecture Contract

Search rows are route rows, not bare model strings.

A cross-provider result must visibly carry:

  • provider display name;
  • canonical/logical model when known;
  • provider wire model id;
  • readiness/auth state;
  • capability summary;
  • pricing/provenance summary when known;
  • selection effect, such as KeepsCurrentProvider, SwitchesProvider, or SelectsCustomModelForProvider.

Selecting any row should produce a provider-scoped route reference and let #3384 resolve/validate it before UI/config/engine state changes.

Custom model ids are allowed only as explicit provider-scoped custom rows. Do not infer provider switching from the typed model string.

Desired User Flow

  1. Run /model.
  2. Type a query such as kimi, qwen, glm, gpt, codex, trinity, claude, ollama, or a custom model id.
  3. See matching rows grouped/labeled by provider.
  4. Select a row to switch both provider and model in one route action.
  5. If no catalog match exists, choose Use "<query>" with <provider> as an explicit provider-scoped custom route.

UX Requirements

  • Provider-scoped current-provider rows remain the default/main section from v0.8.65: Provider-scoped model candidates for /model, picker, and slash completions #3383.
  • Cross-provider search results appear in a separate Switch route section or mode.
  • Rows show provider and model together; no cross-provider row appears as a plain model row.
  • Search covers provider names/aliases and model ids.
  • auto remains available but does not dominate search results.
  • Thinking/reasoning controls remain available, but provider/model discovery is primary.
  • If a row is not ready because auth/base URL/capability requirements are missing, it can be shown with status but cannot silently mutate state.

Implementation Notes

  • Build rows from the shared catalog/projection services, not from UI-local provider/model match tables.
  • Until full catalog data exists, derive provisional rows from provider descriptors plus static offerings and saved provider-scoped models.
  • Use synthetic model ids in tests; avoid full hosted-provider snapshot lists.
  • Keep slash completions aligned with candidate/search APIs rather than direct provider-specific completions.

Acceptance Criteria

  • /model lets users type a search query and filters rows live.
  • Search results can include models from providers other than the active provider, but only as explicit route rows.
  • Selecting a cross-provider row switches both provider and model through the route resolver.
  • Unknown typed model ids can still be used via an explicit provider/custom row.
  • Existing auto and thinking/reasoning behavior remains available.
  • Tests cover same-provider selection, cross-provider selection, typed filtering, no-match custom row, saved provider models, and failed route resolution rollback.

Verification

cargo test -p codewhale-tui model_picker --locked
cargo test -p codewhale-tui model_metadata --locked
cargo test -p codewhale-tui route_resolver --locked
cargo test -p codewhale-tui config --locked

Manual smoke:

/model kimi
/model qwen
/model openrouter qwen
/model ollama qwen

Expected: matching rows are clearly provider-scoped, selecting a different-provider row applies a route switch through #3384, and no custom string silently switches provider.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmodel-labModel Lab open-model discovery, evaluation, routing, and export workflowstuiTerminal UI behavior, rendering, or interactionv0.8.65Targeting v0.8.65

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions