Repository navigation
feat: show model and client icons in the AI spend cost details - #32556
Conversation
23488ba to
8f9ff70
Compare
mollymaefraser
left a comment
There was a problem hiding this comment.
LGTM 🚀 few non-blocking nits but thats all 😄
| import { AIBridgeClientIcon } from "#/pages/AIBridgePage/icons/AIBridgeClientIcon"; | ||
| import { AIBridgeModelIcon } from "#/pages/AIBridgePage/icons/AIBridgeModelIcon"; |
There was a problem hiding this comment.
nit: This makes the AI Spend page import from another page (#/pages/AIBridgePage/icons/...). ProviderIcon already lives in #/modules/aiModels/. Could AIBridgeModelIcon and AIBridgeClientIcon move there too, so pages don't depend on each other? Fine as a follow-up.
There was a problem hiding this comment.
We already follow this pattern in a few places, so I'd prefer to keep it as is for now. I wouldn't move them to aiModels,, though, since that module is about model configuration and client icons don't really fit there. I agree a shared module would be cleaner, but I'd prefer to do that in a separate PR.
| <AIBridgeModelIcon | ||
| model={model.name} | ||
| className="size-icon-sm" | ||
| /> |
There was a problem hiding this comment.
nit: An unknown provider gets the Building2Icon fallback from ProviderIcon, but an unknown model or client gets a plain grey dot. So in the UnpricedUsage story, llama-4-maverick looks different from an unknown provider in the same dialog. This matches the sessions pages, so I'm fine leaving it. Just flagging the inconsistency in case we want one fallback across all three sections.
There was a problem hiding this comment.
Yeah, good point, we should probably unify them. That would change the sessions pages too, so I'd prefer to handle it separately.
| <AIBridgeClientIcon | ||
| client={client.name} | ||
| className="size-icon-sm" | ||
| /> |
There was a problem hiding this comment.
nit: AIBridgeClientIcon matches exact, case-sensitive names ("Cursor", "Claude Code", …). That works for the names AI Bridge sends today. Anything else, including the Unknown the backend uses when no client is recorded, falls back to the grey dot. No change needed here, just noting it in case client names get normalised differently in the spend queries.
There was a problem hiding this comment.
The spend queries read the same client values as the sessions pages, so the names match. Unknown falls back to the grey dot, which seems right for a missing client.
Description
The cost details dialog shows provider icons, but no icons for models and clients. The AI Gateway sessions pages show them, so the dialog now does too.
Example

Changes
AIBridgeModelIconandAIBridgeClientIconnext to each model and client, the same icons the AI Gateway sessions pages use.Related to AIGOV-732
Note
Generated by Coder Agents on behalf of @ssncferreira.