Repository navigation
feat(ui): Model Providers settings page with auth, quota, and cost per provider - #104061
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 10:14 PM ET / July 11, 2026, 02:14 UTC. Summary Reproducibility: not applicable. This PR adds a new Control UI aggregation page rather than fixing a reproducible broken behavior. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Approve the dedicated Settings destination explicitly, then refresh the branch against current main and attach redacted real-gateway browser proof before landing the existing shared-component implementation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new Control UI aggregation page rather than fixing a reproducible broken behavior. Is this the best way to solve the issue? Unclear at the product level: the code is a maintainable reuse of existing RPCs and rendering, but maintainers still need to confirm that a dedicated Settings destination is preferable to enhancing the existing Usage and auth surfaces. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b7156ce68884. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
2f5b623 to
829b1cd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 829b1cd59e
ℹ️ 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".
| (error: unknown) => ({ ok: false as const, error }), | ||
| ), | ||
| client | ||
| .request<{ models?: ModelCatalogEntry[] }>("models.list", {}) |
There was a problem hiding this comment.
Use configured model catalog for provider cards
For configs that expose a provider through wildcard model visibility (for example agents.defaults.models['vllm/*']), the gateway only forces full catalog discovery when models.list is called with view: 'configured' (src/agents/model-catalog-browse.ts). The default {} request stays on the read-only/timeout path, so API-key providers that are intentionally absent from models.authStatus can be hidden entirely or show zero models on this new page even though they are configured; the chat picker already uses the configured view for this reason.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
Closes #104040
What Problem This Solves
Resolves a problem where there was no single place in the Control UI to see which model providers are configured on a gateway and how they are doing. Auth health lived in the CLI and the chat composer's quota popover, live plan/quota/billing cards sat at the bottom of the Usage dashboard, and locally computed session spend was buried in Usage aggregates — so questions like "is my Claude subscription about to hit its weekly limit, and what did OpenAI cost me this month?" required visiting three surfaces.
Why This Change Was Made
Adds a Settings → Model Providers page (
/settings/model-providers, in the Agents & Tools group) that merges four existing gateway RPCs into one card list — no new RPC or config surface. Each configured provider renders as a card with its brand icon, auth pill (connected / expiring / expired / not signed in / API key), model availability, live plan/quota windows, balances/spend/budgets, provider-billed cost history, and locally computed session spend for the last 30 days. Provider alias ids (e.g.claude-cli→anthropic) canonicalize with the same table the gateway uses so one subscription stays one card, and the page reloads when the gateway client changes.The change also consolidates duplicated presentation code instead of adding a third copy: the provider brand icon resolver and provider display labels moved out of the chat model picker into a shared
ui/src/components/provider-icon.ts, and the Usage dashboard's provider usage card body (quota bars, billing rows, cost-history chart) moved into a sharedui/src/components/provider-usage.tsthat both pages render.Data sources:
models.authStatus(provider list + credential health + embedded quota),models.list(model counts/availability),usage.status(live plan/quota/billing/cost history),sessions.usageaggregates.byProvider(local 30-day spend). Providers with no auth, no available models, no usage snapshot, and no recorded spend stay hidden as browse-only catalog entries.User Impact
Operators get one Settings entry that answers "which model providers are configured, are their credentials healthy, what quota is left, and what are they costing me" — with icons, plan badges, quota bars with reset times, credit balances, provider-billed cost charts, and local session spend per provider. A Refresh button re-reads credential state and provider usage on demand.
Evidence
Screenshots (mock gateway fixtures via
pnpm dev:ui:mock):ui/src/pages/model-providers/data.test.ts(7 cases: alias merge with and without usage enrichment, auth-severity merge, usage.status precedence, local-cost attachment, browse-only filtering, sorting).ui/src/e2e/model-providers.e2e.test.ts(auth pill, plan badge, quota bar, balance, local spend, alias merge, hidden unconfigured provider) — passes locally with Playwright Chromium.ui/src/pages/model-providers,app-navigation*,pages/usage/view.test.ts,chat-composer.test.ts,lib/chat/model-select-state.test.ts— all green.pnpm check:changed(delegated to Testbox) green.gpt-5.5, thinking high): two P2 findings (stale data across gateway client swaps; alias merge depending on optional usage embed) — both fixed in this PR with regression coverage; rerun clean.