feat(opencode): show quota usage toast after quota refresh#36
Open
iceteaSA wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
3 issues found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/opencode/src/index.ts">
<violation number="1" location="packages/opencode/src/index.ts:428">
P2: Fallback quota command output drops fresh per-account refresh errors by always passing an empty error map.</violation>
</file>
<file name="packages/core/src/quota-manager.ts">
<violation number="1" location="packages/core/src/quota-manager.ts:88">
P2: Persisted main quota cache uses interval-only staleness instead of policy-aware `getQuotaNextRefreshAt`, causing premature refreshes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
4ad7d49 to
b20b6c0
Compare
3241b3e to
2ec54d4
Compare
Displays quota usage bar notifications via client.tui.showToast after quota data is refreshed. Shows main and fallback account usage with visual bars, percentage, and reset time. Toast variant reflects severity (info < 70%, warning >= 70%, error >= 90%).
Align the quota refresh toast with the sidebar's visual language: - Replace the emoji status dots with status words (active/idle) - Use the shared bar width and a padded percentage via a quotaLine helper - Rename the seven-day label from 1w to 7d to match the sidebar - Keep severity-driven variant color (info/warning/error)
2ec54d4 to
95a1614
Compare
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.
Displays quota usage bar notifications via
client.tui.showToastafter quota data is refreshed.█░)Single file change:
packages/opencode/src/index.ts(+127 lines)Summary by cubic
Shows a quota usage toast after quota refresh, styled to match the TUI sidebar. Integrates the shared
QuotaManagerfrom@cortexkit/anthropic-auth-coreso routing gets fresh quota without blocking and displays a toast when refresh completes, including background every‑N refreshes.client.tui.showToast: shows main and enabled fallbacks with shared‑width bars, padded percent, reset time; “active/idle” labels; “7d” label; clamps >100%; info/warning/error variants.QuotaManagercache for main and fallback snapshots; triggers toast afterrefreshMainand when a background refresh resolves; marks the active account in the message based on current quota policy.Written for commit 95a1614. Summary will update on new commits.