Repository navigation
Conversation
OpenCode 2 had no quota sidebar: the generation-2 TUI only registered /claude and toasts, so 5h/7d bars, pacing, routing and health were only visible on OpenCode 1. - the OpenCode 2 server answers a new `sidebar` method on the existing native RPC with the OpenCode 1 SidebarState, projected from the native account snapshot (v2/sidebar.ts); the output is normalized fail-closed and carries no token, key, receipt or account identity - the active account is per session: the native source records the account behind each session's latest authorization and forgets it with the session - the sidebar rendering moves unchanged from tui.tsx to tui/claude-sidebar.tsx, shared by both generations with the same tui-preferences.jsonc settings; tui.tsx keeps file polling and dialogs - on OpenCode 2, entry.mjs loads the precompiled renderer and setupAnthropicTui mounts it on sidebar.content with the host theme mapped to the flat tokens; it polls per session and shows "Waiting for quota" against servers without the method Docs and changelog updated. #379 is unchanged and a fix in the shared renderer will cover both generations.
- Countdowns, reading ages, pacing and backoff times read a sidebar
clock that ticks at the poll interval and on each state change, so
they advance while the server answers the same state. Quota bar
segments are keyed by position so the tick does not remount them.
- Turned-off vault accounts stay listed with OpenCode 1's custody
state ("turned off"); vaultServed and vaultReauth follow it.
- A local account with an unsupported saved credential shows why it
cannot serve instead of looking ready.
- Refresh backoffs are matched to the account identity, so one left by
a replaced login no longer shows.
- The collapsed rows mark no account active before one has served the
session, matching the expanded view, in both generations.
- A failing slot claim disposes the preference watcher.
- Docs: the RPC answer carries route ids and labels but no tokens,
keys, provider account identities or credential material; STRUCTURE
names the raw TSX fallback. Changelog entry moved to Unreleased.
Tests: countdown advances without a state change, last quota kept
after failed polls, turned-off/cold/served vault rows, unsupported
credential, replaced-login backoff, cache keepalive enabled flag,
no active collapsed row before the first request.
# Conflicts: # CHANGELOG.md
…es watcher Setup keeps the /claude menu when the sidebar cannot mount. The test checks that the controller created for the refused slot is disposed: the child process must exit on its own, which a leaked preferences directory watcher prevents. Removing the dispose in mountClaudeSidebar makes it fail.
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.
CI-only mirror of the outside contribution #395 (its fork PR does not run our workflows until approved). Not to be merged; #395 itself is the PR of record.
Summary by cubic
CI-only mirror of outside contribution #395, letting our workflows run before the fork PR is approved. Do not merge — #395 is the PR of record.
Adds the CLAUDE quota sidebar to OpenCode 2, reusing the OpenCode 1 renderer through a shared component and answering it over a new native RPC
sidebarmethod. Includes review fixes (per-session sidebar clock, "cannot serve" reasons, no active row before first request) and a test ensuring a refused sidebar mount disposes the preferences watcher.Written for commit b04aa63. Summary will update on new commits.