Skip to content

PR3 of #136: cross-route model search - #222

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/cross-route-model-search-pr3
Aug 4, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/cross-route-model-search-pr3

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Final PR of the phased #136 sequence (provider/model/effort picker redesign). PR1 (#215) added the persistent footer control; PR2 (#221) fixed zero-state onboarding correctness. PR3 covers issue #136's "Cross-route model search" section — specifically the compact model control (footer [model] segment / Alt+C), which today does not actually search across routes despite the issue's explicit requirement.

Three concrete gaps found and fixed:

  • Search was scoped to one route, not cross-route, in the common case. The compact picker's selected_route seeded from whatever profile was currently active, and a connected user almost always has one — so the "cross-route" control opened already narrowed to a single route. Split the constructor's overloaded current_profile_id parameter (which conflated "what marks a row current" with "what seeds the search scope") so the compact control now starts unscoped by default. The full-screen /connect//model picker is unchanged — that's a deliberate guided browse, not "the model control."
  • Search never matched the vendor/route label, only the bare model id. ModelItem gains a pre-resolved route_label ("OpenAI" / "OpenAI · ChatGPT sign-in"), computed once via the existing vendor_route_labels helper, and the matcher checks it alongside the model id, case-insensitively.
  • Multi-route ambiguity was resolved silently — Enter on a model offered by more than one connected route auto-picked CatalogSource::Live else the first route, with the code's own comment calling it a "catalog quirk." Replaced with explicit, individually-selectable rows: each route now renders as its own row named by its route label, so the choice is always unambiguous — no auto-pick logic left at all.

Also: the Models column's empty state now distinguishes "no provider connected" / "catalog still loading" (new catalog_loading flag wired through the existing background-refresh machinery from PR1) / "nothing cached yet" / "no matches for this filter", instead of two generic messages. And a new regression test confirms a picker selection with an explicit route never crosses wires between openai (generic API key) and openai_codex (subscription/OAuth) even when both are connected simultaneously — atomicity was already correct structurally, this just locks it in.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test -p forge-tui --lib (739 passed)
  • cargo test -p forge-connect --lib (184 passed)
  • cargo test --workspace --all-targets --locked — all green except the same pre-existing, unrelated forge-config::permissions failure documented in PR1/PR2 (this dev machine's real local config leaking into unisolated tests; zero diff to that crate).

Final PR of the phased #136 sequence. The compact model control (footer
[model] segment / Alt+C picker) now genuinely searches across every
connected route instead of silently narrowing to whichever route happens
to be active — the full-screen /connect and /model picker keeps its
existing guided-browse scoping unchanged.

- Split connect_model_open_impl's single current_profile_id parameter
  into "what marks a row current" vs "what seeds the initial search
  scope" — the compact control now starts unscoped by default.
- Model search matches the vendor/route label text as well as the model
  id, case-insensitively (ModelItem gains a pre-resolved route_label,
  filled in once by TuiApp::model_picker_items via the existing
  vendor_route_labels helper).
- A model offered by more than one connected route no longer gets
  silently auto-resolved (previously: prefer Live source, else first).
  Each route now renders as its own explicitly selectable row named by
  its route label, removing the "catalog quirk" auto-pick entirely.
- The Models column's empty state distinguishes "no provider connected",
  "catalog still loading" (new catalog_loading flag, set/cleared around
  the existing background catalog-refresh machinery), "nothing cached
  yet", and "no matches for this filter" instead of two generic messages.
- Added a regression test confirming a picker selection with an explicit
  route never crosses wires between openai (generic API key) and
  openai_codex (subscription/OAuth) even when both are connected.
@github-actions
github-actions Bot enabled auto-merge (squash) August 4, 2026 01:08
@github-actions
github-actions Bot merged commit 1c9e6c3 into main Aug 4, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
Final PR of the phased #136 sequence. The compact model control (footer
[model] segment / Alt+C picker) now genuinely searches across every
connected route instead of silently narrowing to whichever route happens
to be active — the full-screen /connect and /model picker keeps its
existing guided-browse scoping unchanged.

- Split connect_model_open_impl's single current_profile_id parameter
  into "what marks a row current" vs "what seeds the initial search
  scope" — the compact control now starts unscoped by default.
- Model search matches the vendor/route label text as well as the model
  id, case-insensitively (ModelItem gains a pre-resolved route_label,
  filled in once by TuiApp::model_picker_items via the existing
  vendor_route_labels helper).
- A model offered by more than one connected route no longer gets
  silently auto-resolved (previously: prefer Live source, else first).
  Each route now renders as its own explicitly selectable row named by
  its route label, removing the "catalog quirk" auto-pick entirely.
- The Models column's empty state distinguishes "no provider connected",
  "catalog still loading" (new catalog_loading flag, set/cleared around
  the existing background catalog-refresh machinery), "nothing cached
  yet", and "no matches for this filter" instead of two generic messages.
- Added a regression test confirming a picker selection with an explicit
  route never crosses wires between openai (generic API key) and
  openai_codex (subscription/OAuth) even when both are connected.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Final PR of the phased #136 sequence. The compact model control (footer
[model] segment / Alt+C picker) now genuinely searches across every
connected route instead of silently narrowing to whichever route happens
to be active — the full-screen /connect and /model picker keeps its
existing guided-browse scoping unchanged.

- Split connect_model_open_impl's single current_profile_id parameter
  into "what marks a row current" vs "what seeds the initial search
  scope" — the compact control now starts unscoped by default.
- Model search matches the vendor/route label text as well as the model
  id, case-insensitively (ModelItem gains a pre-resolved route_label,
  filled in once by TuiApp::model_picker_items via the existing
  vendor_route_labels helper).
- A model offered by more than one connected route no longer gets
  silently auto-resolved (previously: prefer Live source, else first).
  Each route now renders as its own explicitly selectable row named by
  its route label, removing the "catalog quirk" auto-pick entirely.
- The Models column's empty state distinguishes "no provider connected",
  "catalog still loading" (new catalog_loading flag, set/cleared around
  the existing background catalog-refresh machinery), "nothing cached
  yet", and "no matches for this filter" instead of two generic messages.
- Added a regression test confirming a picker selection with an explicit
  route never crosses wires between openai (generic API key) and
  openai_codex (subscription/OAuth) even when both are connected.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Final PR of the phased #136 sequence. The compact model control (footer
[model] segment / Alt+C picker) now genuinely searches across every
connected route instead of silently narrowing to whichever route happens
to be active — the full-screen /connect and /model picker keeps its
existing guided-browse scoping unchanged.

- Split connect_model_open_impl's single current_profile_id parameter
  into "what marks a row current" vs "what seeds the initial search
  scope" — the compact control now starts unscoped by default.
- Model search matches the vendor/route label text as well as the model
  id, case-insensitively (ModelItem gains a pre-resolved route_label,
  filled in once by TuiApp::model_picker_items via the existing
  vendor_route_labels helper).
- A model offered by more than one connected route no longer gets
  silently auto-resolved (previously: prefer Live source, else first).
  Each route now renders as its own explicitly selectable row named by
  its route label, removing the "catalog quirk" auto-pick entirely.
- The Models column's empty state distinguishes "no provider connected",
  "catalog still loading" (new catalog_loading flag, set/cleared around
  the existing background catalog-refresh machinery), "nothing cached
  yet", and "no matches for this filter" instead of two generic messages.
- Added a regression test confirming a picker selection with an explicit
  route never crosses wires between openai (generic API key) and
  openai_codex (subscription/OAuth) even when both are connected.
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