Skip to content

feat(engine): add usage quota tracking and indicator ui for ai providers#423

Open
rust142 wants to merge 2 commits into
myrialabs:mainfrom
rust142:dev/usage-quota
Open

feat(engine): add usage quota tracking and indicator ui for ai providers#423
rust142 wants to merge 2 commits into
myrialabs:mainfrom
rust142:dev/usage-quota

Conversation

@rust142

@rust142 rust142 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Introduce a unified usage quota system across all supported AI engine adapters (Claude Code, Copilot, Codex, OpenCode). Each adapter parses provider-specific usage output (CLI commands, API responses, or database queries) into a common UsageSnapshot schema with typed UsageQuota entries. A new engine:get-usage WebSocket endpoint exposes snapshots to the frontend, where a compact UsageIndicator component displays remaining quota percentages in the chat panel header. The indicator adapts to narrow layouts via container queries and offers a detail popover with per-quota breakdowns, color-coded thresholds, reset timestamps, and a manual refresh button. Previously users had no visibility into their consumption limits; this change provides real-time awareness to prevent unexpected service interruptions.

rust142 added 2 commits July 15, 2026 15:11
Introduce a unified usage quota system across all supported AI engine adapters (Claude Code, Copilot, Codex, OpenCode). Each adapter parses provider-specific usage output (CLI commands, API responses, or database queries) into a common UsageSnapshot schema with typed UsageQuota entries. A new engine:get-usage WebSocket endpoint exposes snapshots to the frontend, where a compact UsageIndicator component displays remaining quota percentages in the chat panel header. The indicator adapts to narrow layouts via container queries and offers a detail popover with per-quota breakdowns, color-coded thresholds, reset timestamps, and a manual refresh button. Previously users had no visibility into their consumption limits; this change provides real-time awareness to prevent unexpected service interruptions.
…ta display

Adds a usageError state to display a warning icon and 'Error' label when quota fetching fails, replacing the silent failure mode. Tracks sessionState.isLoading in the effect to ensure the usage indicator updates reactively when message generation state changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant