feat(tui): cross-field search in model + provider pickers (#4141)#4218
Conversation
…4141) Complete cross-field search across provider name, display model name, and wire model id in both the model and provider pickers so they behave consistently (Fixes #4141). - model_picker: model_row_matches_query already matched the provider key, provider display name, and the model id (which is both the displayed name and the wire id). Made case handling consistent with the provider picker by lowercasing the provider key before matching. - provider_picker: matches_query now also searches the default route's display model name (logical_model) and wire model id (wire_model), so a model name or wire id surfaces the provider that serves it. This aligns the code with its existing doc comment and with the model picker. Rendering/truncation is untouched, so dense/narrow disclosure stays trimmed. Tests: focused cases proving the model picker matches by provider name, display model name, and wire model id, and that a non-matching query returns no rows; plus a provider-picker test proving route model/wire-id matching. Implemented with agent assistance.
|
Claude finished @Hmbown's task in 2m 30s —— View job Reviewing PR #4218
SummaryReviewed the diff ( Correctness
Provider/model/route safety (v0.8.65 EPIC #2608 invariant)
Reuse/simplification
Tests
Security
Note on verification: I was unable to run No blocking issues found. Nice work keeping the two pickers' search semantics aligned. |
Fixes #4141
Summary
Completes cross-field search across provider name, display model name, and wire model id in both the model picker and the provider picker, so the two pickers behave consistently.
What now matches
model_row_matches_query): already matched the provider key, the provider display name, androw.id— which in the model picker is both the displayed model name and the id sent to the provider (its wire id). Made case handling consistent with the provider picker by lowercasing the provider key before comparing (everything else was alreadyto_ascii_lowercase()+ substring).ProviderDashboardRow::matches_query): now also searches the default route's display model name (logical_model) and wire model id (wire_model), in addition to the existing provider name / id / kind / base URL / provider key. This means a model name or wire id now surfaces the provider that serves it — aligning the code with its own doc comment ("the compact hint fields") and with the model picker.Consistency
Both matchers use identical semantics: trim,
to_ascii_lowercase(), case-insensitive substring across the relevant fields. A query that matches a provider name / model name / wire id in one picker matches the analogous field in the other.Acceptance criteria
narrow_picker_rows_hide_hint_before_clipping_model_idstays green).Tests
model_row_query_matches_provider_name— matches by provider key and display name.model_row_query_matches_display_model_name— matches by the displayed model name.model_row_query_matches_wire_model_id— matches by the full wire id.model_row_query_no_field_match_returns_false+picker_query_by_wire_id_surfaces_cross_provider_row_and_hides_others— a non-matching query returns no rows; a model-name query surfaces the serving provider's route.provider_row_query_matches_default_route_model_and_wire_id— the provider picker now matches its route model/wire id (consistency lock).Verification
cargo build -p codewhale-tui --locked,cargo test -p codewhale-tui --all-features --locked,cargo fmt --all -- --check,cargo clippy --workspace --all-features --locked -- -D warnings ...,cargo test --workspace --all-features --locked, andcargo build --releaseall pass. The only failing test is the known pre-existingskill_hotbar_action_*env/skill-cache flake.Guards respected: no module/struct/fn renames, no
DEEPSEEK*env changes, no provider/model inference, no provider privileging, nocrates/configedits — TUI-only.Generated with Claude Code