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
84f44e5 to
583586a
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.
|
09b34c3 to
8339edc
Compare
9a8f78a to
26466b6
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
903bc95 to
eb5f89e
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.
…reshold Self-review fixes folded in: - Token-aware fail-closed read: const mainQuota = quotaManager.getMain(auth.access) so a previous main account's cached quota can't satisfy the fail-closed check or feed the killswitch eval after a main-account switch. - Removed a stray inner 'let sessionRequestCount = 0' + unconditional increment that shadowed the process-scoped counter, which had left the active-route fallback every-N refresh reading a never-incremented counter.
# Conflicts: # README.md
Layer killswitch awareness onto the restyled sidebar (killed state in SidebarState + writeSidebarState via killswitchPassesPolicy, blocked status word, Killswitch health row, degraded/LIMITED inclusion). Also restores the process-scoped 'let sessionRequestCount' (a prior cascade had flipped it to const, which left the active-route fallback every-N refresh reading a never-incremented counter).
eb5f89e to
e86d9d3
Compare
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 a killswitch and a restyled, real-time TUI quota sidebar. Blocks low‑quota requests and shows live quota, backoff, killswitch state, and cache keepalive in the sidebar.
New Features
/claude-killswitchon/off/set/status../tuiin@cortexkit/opencode-anthropic-auth, register inoc-plugin; add@opentui/core,@opentui/solid,solid-js; copytui.tsxat build;@cortexkit/anthropic-auth-corenow exportskillswitchAPIs; READMEs document/claude-killswitchand TUI registration.Bug Fixes
getMain().QuotaManagercache as the single source of truth; token‑bind fallback cache entries and invalidate on re‑login.Written for commit e86d9d3. Summary will update on new commits.