fix(display): preserve all providers in merged Models rows - #764
Merged
Conversation
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
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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
) 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #763, addressing a P2 review note.
The bug
aggregate_model_usage_entriesjoins multiple providers for a merged row as a", "-separated string (e.g. a model used via both openai and openrouter →"openai, openrouter") for every grouping exceptClientProviderModel. The display mapper introduced in #763 matched a brand prefix/contains branch (openai*,kimi*,*copilot*) against the whole joined string and returned a single brand — silently dropping the other providers:"openai, openrouter"→"OpenAI"(openrouter gone)"kimi, anthropic"→"Kimi"(anthropic gone)(Ironically the old exact-match mapper didn't hit this; the new prefix matching did — a regression from #763.)
The fix
Make the mapper list-aware: split
entry.provideron", ", map each segment via a newmap_single_providerhelper, and rejoin. So"openai, openrouter"→"OpenAI, OpenRouter". Also added an explicitopenrouter → "OpenRouter"arm.Tests
New
provider_display_name_merged_list_maps_each_segmentcoversopenai, openrouter→OpenAI, OpenRouter,kimi, anthropic→Kimi, Anthropic, the copilot-contains case (anthropic, copilot→Anthropic, GitHub Copilot), and order preservation.build/test/clippy/fmt --checkall green.Summary by cubic
Fix provider display in merged Models rows by mapping each provider in comma-joined strings, preserving all providers (e.g., "openai, openrouter" → "OpenAI, OpenRouter"). Adds a helper for single-provider mapping and an explicit "OpenRouter" display name.
map_single_provider, then rejoin.openrouter→ "OpenRouter" mapping.*copilot*contains case, and order preservation.Written for commit e300409. Summary will update on new commits.