feat(opencode): add killswitch indicators to TUI sidebar#39
Conversation
There was a problem hiding this comment.
2 issues found across 16 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
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)
…reshold Per-account request blocking when remaining quota drops below configurable thresholds. Returns synthetic 429 when all accounts (main + fallbacks) are below their thresholds. Includes /claude-killswitch slash command for runtime management. Features: - Per-account threshold overrides (5h and 7d windows) - Eager quota refresh on first request for killswitch evaluation - Skip-main routing when main is killed (try surviving fallbacks) - Filter killed accounts from reactive fallback path - Retry-After header with earliest quota reset time
bfdd490 to
84f44e5
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)
Shows killed account status (red dot), quota/refresh backoff state, and kill summary in the sidebar widget.
84f44e5 to
583586a
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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.
|
Adds killswitch awareness to the TUI sidebar widget:
writeSidebarState()computes killswitch policy for all accountsFiles:
packages/opencode/src/sidebar-state.ts— addskilled, backoff fieldspackages/opencode/src/tui.tsx— killed indicator, kill status sectionpackages/opencode/src/index.ts— killswitch-aware sidebar stateSummary by cubic
Adds killswitch status to the TUI sidebar and wires it to a shared
QuotaManagerfor real-time quota and backoff with persisted state and cross-process dedupe. Also writes a sidebar state file and exposes the TUI module so the UI can render without extra fetches.QuotaManager: unified cache for main + fallbacks with inflight dedupe, exponential backoff, request-count-based refresh, persisted main quota/backoff, and cross-process file-lock dedup.writeSidebarState()computes killswitch/quota/backoff for main and fallbacks and persists it for the TUI./claude-killswitchcommand to view, enable/disable, and set per-account thresholds.@cortexkit/opencode-anthropic-auth./tuiexport and copiestui.tsxat build.Written for commit 583586a. Summary will update on new commits. Review in cubic