feat: add provider allowance indicators - #1116
Draft
ferrislucas wants to merge 34 commits into
Draft
Conversation
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…2, finding #2) Co-authored-by: Codex <noreply@openai.com>
…ediation W4, finding #4) Co-authored-by: Codex <noreply@openai.com>
…#5) Co-authored-by: Codex <noreply@openai.com>
…finding #7) Co-authored-by: Codex <noreply@openai.com>
…W9, finding #10) Co-authored-by: Codex <noreply@openai.com>
Add provider-allowance-indicators E2E spec with stable data-testids on the allowance items and overflow button, constrain the indicator widths on desktop and reset them on mobile so layout stays predictable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: z.ai <noreply@z.ai>
…into circus-chief/bc77-how-support-feature-shows
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…into circus-chief/bc77-how-support-feature-shows
The provider allowance indicators shipped gated behind an opt-in provider_allowance_indicators_v1 app_settings flag with no UI to enable it, leaving the feature unreachable in normal environments. Ship the feature unconditionally instead: - Delete providerAllowanceFeatureFlag.js and the isEnabled gate from ProviderAllowanceService (getSnapshots/observe are now always-on) - GET /api/providers/allowances always returns snapshots; the VCR-only test-observe harness no longer writes the flag row - Update API and service tests that asserted flag-gated behavior Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: z.ai <noreply@z.ai>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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.
Summary
Adds provider allowance (usage/quota) indicators so users can see at a glance how much of each provider's allowance remains.
ProviderAllowanceServicethat maintains per-provider snapshots. Providers without a verified allowance source are represented asunknownrather than inferred from call logs or credentials. Emits aPROVIDER_ALLOWANCE_UPDATEDWebSocket message only when a snapshot actually changes.ProviderAllowanceSnapshot,ProviderAllowance, status/unit/source enums, and the WS update payload. Snapshots are.strict()and carry only normalized, display-safe values (raw provider headers and account metadata stay server-side).GET /api/providers/allowances(registered before/:idso it's never parsed as a provider id).ProviderAllowanceIndicatorscomponent in the app shell — compact desktop pills showing the lowest remaining percentage per provider, an overflow button, and a mobile button with an attention badge. Opens an accessible modal (focus trap via focus management, Esc to close, focus restore) listing full allowance details, reset times, and staleness warnings. Backed by a newproviderAllowancesPinia store that fetches on mount, applies WS updates, and refetches on reconnect.Test plan
ProviderAllowanceService, shared contracts, and theProvidersApiresourceSessionCard,SessionLogStream,sessionStreaming, andSessionListViewtests affected by the log-stream changesyarn testgreen across workspaces./scripts/pw.sh test🤖 Generated with Claude Code