feat(opencode): TUI sidebar quota widget#37
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
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
545bea1 to
9b160a1
Compare
d7f7195 to
5c82459
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
38b3d9b to
a9dfa9c
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)
Regenerate the lockfile so it resolves @opentui/core, @opentui/solid, and solid-js added to packages/opencode/package.json, and apply biome formatting to tui.tsx. Fixes CI 'bun install --frozen-lockfile' and 'format:check'.
Align the quota sidebar with the styling used by other CortexKit OpenCode TUI tools (e.g. aft): - Bordered panel with a CLAUDE badge header and a LIMITED badge when degraded - Reusable SectionHeader and StatRow components; box padding instead of leading-space indentation - Theme tokens only via a tone system (ok/warn/err/muted/accent) — no hardcoded hex/named color fallbacks - Surface previously-missing state: Cache (1h keepalive window + tracked sessions) and Health (quota-API / token-refresh backoff) - Account status words (active/idle) replace the ad-hoc dot glyph - Event-driven refresh (session/message) with debounce plus a poll backstop - Slot order 150 -> 160 to match the convention used by other TUI panels Backoff state is quota-manager-derived and lives in the base sidebar; the killswitch block display is added separately on the killswitch sidebar branch so this non-killswitch widget carries no killswitch code. Documents the sidebar and tui.json registration in the README.
Render each quota window as fixed-width left-aligned columns (label, bar, percentage) and push the reset time to the right edge so bars/percentages line up across rows and reset times share a right-aligned column.
a9dfa9c to
4af7377
Compare
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 for live Claude quota and unifies quota handling behind
QuotaManagerfor main and fallback accounts to cut 429s and keep state consistent. The sidebar shows usage, health, and cache-keepalive, and updates on events with a debounced refresh plus a 1.5s poll backstop.New Features
@opentui/core/@opentui/solid; README docs withtui.json. Writes tmpsidebar-state.json. Package exposes./tuiviaoc-plugin; build copiestui.tsxtodist/.Bug Fixes
getMain()and fallback cache entries are bound to the live token; cross‑token seeds are dropped.QuotaManager’s cache to match staleness checks.Written for commit 4af7377. Summary will update on new commits.