Skip to content

CI only: PR #395 at 1f1b92b1 - #412

Merged
ualtinok merged 4 commits into
mainfrom
ci/pr-395
Oct 20, 2026
Merged

ualtinok merged 4 commits into
mainfrom
ci/pr-395

Conversation

@antauth-alfonso

@antauth-alfonso antauth-alfonso Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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 sidebar method. 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.

View guided diff Turn on auto-fix

TodoniK and others added 4 commits October 20, 2026 14:46
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.
…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.
@antauth-alfonso antauth-alfonso Bot closed this Oct 20, 2026
@antauth-alfonso antauth-alfonso Bot reopened this Oct 20, 2026
@ualtinok
ualtinok merged commit b04aa63 into main Oct 20, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants