Skip to content

feat: show model and client icons in the AI spend cost details - #32556

Merged
ssncferreira merged 1 commit into
mainfrom
ssncf/ai-spend-cost-details-icons
Nov 24, 2026
Merged

ssncferreira merged 1 commit into
mainfrom
ssncf/ai-spend-cost-details-icons

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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
Screenshot 2026-11-24 at 10 25 29

Changes

  • Show AIBridgeModelIcon and AIBridgeClientIcon next 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.

@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

AIGOV-732

@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-cost-details-icons branch from 23488ba to 8f9ff70 Compare November 23, 2026 10:45
@ssncferreira
ssncferreira marked this pull request as ready for review November 24, 2026 10:26

@mollymaefraser mollymaefraser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀 few non-blocking nits but thats all 😄

Comment on lines +26 to +27
import { AIBridgeClientIcon } from "#/pages/AIBridgePage/icons/AIBridgeClientIcon";
import { AIBridgeModelIcon } from "#/pages/AIBridgePage/icons/AIBridgeModelIcon";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Comment on lines +124 to +127
<AIBridgeModelIcon
model={model.name}
className="size-icon-sm"
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, good point, we should probably unify them. That would change the sessions pages too, so I'd prefer to handle it separately.

Comment on lines +136 to +139
<AIBridgeClientIcon
client={client.name}
className="size-icon-sm"
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@ssncferreira
ssncferreira merged commit e9ace93 into main Nov 24, 2026
41 checks passed
@ssncferreira
ssncferreira deleted the ssncf/ai-spend-cost-details-icons branch November 24, 2026 13:26
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 24, 2026

This branch had an error being deployed

1 failed deployment
docs-preview — 8f9ff70b Deployed Nov 24, 2026 by ssncferreira via cleanup #408
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants