Skip to content

fix(display): render provider names correctly in Models views - #763

Merged
junhoyeo merged 1 commit into
mainfrom
fix/provider-display-names
Jun 22, 2026
Merged

fix(display): render provider names correctly in Models views#763
junhoyeo merged 1 commit into
mainfrom
fix/provider-display-names

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Jun 22, 2026

Copy link
Copy Markdown
Owner

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 models report rendered the raw provider id (Cell::new(&entry.provider)) in 6 places — so you saw openai / opencode / google-vertex verbatim.
  • The shared get_provider_display_name mapper's fallback was a naive capitalize-first, producing Google-vertex / Kimi-for-coding for hyphenated ids.

Fix

  • Enriched the canonical mapper (get_provider_display_name): brand-family prefixes (openai*→OpenAI, kimi*→Kimi, copilot→GitHub Copilot), explicit google-vertex/google_vertex→"Google Vertex" (both spellings, since canonical_provider rewrites 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 like some-new-provider now render "Some New Provider".
  • Routed the 6 raw provider cells in run_models_report through 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.provider cells in the models report through get_provider_display_name.
    • Expanded get_provider_display_name with brand-family rules (openai*, kimi*, Copilot variants) and explicit google-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.

Written for commit 3b544dd. Summary will update on new commits.

Review in cubic

Provider names rendered inconsistently: the CLI `models` report printed the
raw provider id (e.g. "openai", "opencode", "google-vertex"), and the shared
provider display mapper's fallback was a naive capitalize-first that produced
"Google-vertex" / "Kimi-for-coding".

- get_provider_display_name: add explicit brand-family handling (openai* ->
  OpenAI, kimi* -> Kimi, google-vertex/google_vertex -> Google Vertex) and
  replace the capitalize-first fallback with a word-splitting title-caser
  (splits on -/_/space, per-word acronym map: AI/GPT/API/LLM/xAI/Vertex), so
  unknown multi-word providers like `some-new-provider` -> "Some New Provider".
- Route the 6 raw entry.provider cells in run_models_report through the mapper
  so the CLI matches the TUI (which already used it).

Adds unit tests for all four reported cases (openai->OpenAI,
kimi-for-coding->Kimi, google-vertex->Google Vertex, opencode->OpenCode) plus
brand families, both google-vertex spellings, the smart fallback, acronym
words, known regressions, and empty/separator-only edges.

Confidence: high
Scope-risk: narrow
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Building Building Preview, Comment Jun 22, 2026 9:54am

Request Review

@junhoyeo
junhoyeo merged commit 4fe49ad into main Jun 22, 2026
14 checks passed
@junhoyeo
junhoyeo deleted the fix/provider-display-names branch June 22, 2026 09:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b544dd287

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +398 to +399
if lower.starts_with("openai") {
return "OpenAI".to_string();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Split merged provider lists before display mapping

When a row merges multiple providers, aggregate_model_usage_entries stores them as a comma-separated string for every grouping except ClientProviderModel; this mapper now treats the whole string as one provider. In a real Models row such as the same model used via openai and openrouter, the sorted provider value becomes openai, openrouter, this prefix branch returns only OpenAI, and the Providers column silently drops openrouter. Split entry.provider on ", " and map each provider before joining, or make this helper list-aware.

Useful? React with 👍 / 👎.

junhoyeo added a commit that referenced this pull request Jun 22, 2026
fix(display): map each provider in merged Models rows

aggregate_model_usage_entries joins multiple providers for a row as a
", "-separated string (e.g. "openai, openrouter") for every grouping except
ClientProviderModel. get_provider_display_name treated the whole string as one
provider, so a brand prefix/contains branch (openai*/kimi*/*copilot*) matched
the first segment and silently dropped the rest ("openai, openrouter" rendered
as just "OpenAI").

Split on ", ", map each segment via a new map_single_provider helper, then
rejoin, so "openai, openrouter" -> "OpenAI, OpenRouter". Also adds an explicit
openrouter -> "OpenRouter" arm.

Addresses the P2 review note on #763.

Confidence: high
Scope-risk: narrow
makoMakoGo added a commit to makoMakoGo/tokscale that referenced this pull request Jun 23, 2026
ported from upstream junhoyeo#760
ported from upstream junhoyeo#762
ported from upstream junhoyeo#763
ported from upstream junhoyeo#764
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
…eo#763)

fix(display): render provider names correctly across Models views

Provider names rendered inconsistently: the CLI `models` report printed the
raw provider id (e.g. "openai", "opencode", "google-vertex"), and the shared
provider display mapper's fallback was a naive capitalize-first that produced
"Google-vertex" / "Kimi-for-coding".

- get_provider_display_name: add explicit brand-family handling (openai* ->
  OpenAI, kimi* -> Kimi, google-vertex/google_vertex -> Google Vertex) and
  replace the capitalize-first fallback with a word-splitting title-caser
  (splits on -/_/space, per-word acronym map: AI/GPT/API/LLM/xAI/Vertex), so
  unknown multi-word providers like `some-new-provider` -> "Some New Provider".
- Route the 6 raw entry.provider cells in run_models_report through the mapper
  so the CLI matches the TUI (which already used it).

Adds unit tests for all four reported cases (openai->OpenAI,
kimi-for-coding->Kimi, google-vertex->Google Vertex, opencode->OpenCode) plus
brand families, both google-vertex spellings, the smart fallback, acronym
words, known regressions, and empty/separator-only edges.

Confidence: high
Scope-risk: narrow
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
)

fix(display): map each provider in merged Models rows

aggregate_model_usage_entries joins multiple providers for a row as a
", "-separated string (e.g. "openai, openrouter") for every grouping except
ClientProviderModel. get_provider_display_name treated the whole string as one
provider, so a brand prefix/contains branch (openai*/kimi*/*copilot*) matched
the first segment and silently dropped the rest ("openai, openrouter" rendered
as just "OpenAI").

Split on ", ", map each segment via a new map_single_provider helper, then
rejoin, so "openai, openrouter" -> "OpenAI, OpenRouter". Also adds an explicit
openrouter -> "OpenRouter" arm.

Addresses the P2 review note on junhoyeo#763.

Confidence: high
Scope-risk: narrow
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