fix(display): render provider names correctly in Models views
Merged
JU
5mo ago+159+159+012345678901234567890123456789-18-18-01234567890123456789
Fixes provider display names that rendered raw or mis-cased: openai → OpenAI, kimi-for-coding → Kimi, google-vertex → Google Vertex, opencode → OpenCode.
Root cause
Two layers:
- The CLI
modelsreport rendered the raw provider id (Cell::new(&entry.provider)) in 6 places — so you sawopenai/opencode/google-vertexverbatim. - The shared
get_provider_display_namemapper's fallback was a naive capitalize-first, producingGoogle-vertex/Kimi-for-codingfor hyphenated ids.
Fix
- Enriched the canonical mapper (
get_provider_display_name): brand-family prefixes (openai*→OpenAI,kimi*→Kimi, copilot→GitHub Copilot), explicitgoogle-vertex/google_vertex→"Google Vertex" (both spellings, sincecanonical_providerrewrites the hyphen to an underscore), and a smart title-case fallback that splits on-/_/space with a per-word acronym map (AI, GPT, API, LLM, xAI, Vertex). Unknown multi-word providers likesome-new-providernow render "Some New Provider". - Routed the 6 raw provider cells in
run_models_reportthrough the mapper, so the CLI matches the TUI (which already used it). Confirmed no other raw-provider cell renders remain.
Tests (all green)
8 new unit tests covering the four reported cases, openai/kimi families, both google-vertex spellings, the smart multi-word fallback, per-word acronyms, known-brand regressions (Anthropic/xAI/DeepSeek/GitHub Copilot/…), and empty/separator-only edges. cargo build/test/clippy/fmt --check all pass (730 + 122 tests).
Summary by cubic
Fixes provider names across Models views so brands render correctly and consistently (e.g., openai → OpenAI, kimi-for-coding → Kimi, google-vertex → Google Vertex). The CLI now matches the TUI, and unknown ids get clean title-casing.
- Bug Fixes
- Routed all
entry.providercells in themodelsreport throughget_provider_display_name. - Expanded
get_provider_display_namewith brand-family rules (openai*,kimi*, Copilot variants) and explicitgoogle-vertex/google_vertex→ Google Vertex. - Replaced naive capitalization with a split-and-title-case fallback with acronym handling (AI, GPT, API, LLM, xAI, Vertex).
- Added unit tests for reported cases, brand families, both Google Vertex spellings, fallback behavior, and regressions.
- Routed all