feat(opencode): TUI sidebar quota widget#37
Open
iceteaSA wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
2 issues found across 12 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
9651130 to
8b20be7
Compare
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
8b20be7 to
3c86178
Compare
Unified quota cache and API gateway for main + fallback quota state. All consumers share one QuotaManager instance for consistent caching. Features: - Inflight deduplication prevents concurrent API calls - Exponential backoff (60s-15min) for 429/5xx errors - Persists main quota and backoff state to disk via callbacks - Cross-process file lock guard for quota API dedup - Seeds from persisted storage on construction - Integrates with FallbackAccountManager for shared staleness - Captures storage path at init to prevent test config corruption - Request-count-based refresh trigger (refreshEveryNRequests)
3c86178 to
545bea1
Compare
Adds a TUI sidebar widget showing real-time quota usage for main and fallback accounts. Displays usage bars, reset times, relay status, fast mode, and cache-keepalive state. New files: sidebar-state.ts, tui.tsx, scripts/copy-tui.mjs Modified: package.json (TUI deps, exports), index.ts (writeSidebarState)
545bea1 to
9b160a1
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.
Adds a TUI sidebar widget showing real-time quota usage for main and fallback accounts.
Displays:
Files:
packages/opencode/src/sidebar-state.ts— new, shared state type + file I/Opackages/opencode/src/tui.tsx— new, Solid.js sidebar componentpackages/opencode/scripts/copy-tui.mjs— new, build helperpackages/opencode/package.json— TUI deps,oc-pluginfield,./tuiexportpackages/opencode/src/index.ts—writeSidebarState()integrationpackages/core/src/cachekeep.ts—trackedCount()getterSummary by cubic
Adds a TUI sidebar that shows live Claude quota and a shared
QuotaManagerwith caching, backoff, and persistence to reduce 429s and stabilize routing. Improves fallback quota freshness and exposes state for the TUI with minimal polling.New Features
sidebar-state.json, TUI polls.QuotaManagerin@cortexkit/anthropic-auth-core: shared main+fallback cache, inflight dedupe, serial API gate, cross‑process file‑lock, exponential backoff (60s–15m) for 429/5xx, persisted main quota and backoff (seed/restore from storage), request‑count refresh viarefreshEveryNRequests, and integration withFallbackAccountManagerfor shared staleness and seeding/sync.QuotaManager; fail‑closed when quota is unknown during backoff (429 with Retry‑After).CacheKeepManager.trackedCount()added for sidebar.Dependencies
@opentui/core,@opentui/solid,solid-js.exports["./tui"]andoc-plugin; build emitssidebar-stateand copiestui.tsx.QuotaManagerfrom@cortexkit/anthropic-auth-core.Written for commit 9b160a1. Summary will update on new commits. Review in cubic