Repository navigation
feat(usage): show remaining quota for the current agent account - #472
Open
Adam-Dalloul wants to merge 75 commits into
Open
Adam-Dalloul wants to merge 75 commits into
Adam-Dalloul wants to merge 75 commits into
Conversation
Adam-Dalloul
force-pushed
the
remaining-quota-honest-panel
branch
from
August 16, 2026 17:01
9f86b6a to
3b55c9f
Compare
Settings MCP still targets the built-in family row. Extra custom agents whose spec.env sets CLAUDE_CONFIG_DIR, CODEX_HOME, GROK_HOME, GEMINI_CONFIG_DIR, or OPENCODE_CONFIG_DIR now receive the same server on upsert and lose it on remove. Claude extra homes only get enabledPlugins; server defs stay in the shared ~/.claude.json. Auth files are never copied.
Custom agents whose spec.env sets a family isolator now have a Sign in card on the Agents page. That opens the official CLI login (claude/codex/grok/gemini/opencode) with the isolator env set. No tokens are copied. Account 1 stays on the built-in home. Headless and unit-test paths return the command instead of spawning a terminal.
Settings MCP still targets the built-in family row. Extra custom agents whose spec.env sets CLAUDE_CONFIG_DIR, CODEX_HOME, GROK_HOME, GEMINI_CONFIG_DIR, or OPENCODE_CONFIG_DIR now receive the same server on upsert and lose it on remove. Claude extra homes only get enabledPlugins; server defs stay in the shared ~/.claude.json. Auth files are never copied.
Custom agents whose spec.env sets a family isolator now have a Sign in card on the Agents page. That opens the official CLI login (claude/codex/grok/gemini/opencode) with the isolator env set. No tokens are copied. Account 1 stays on the built-in home. Headless and unit-test paths return the command instead of spawning a terminal.
Adam-Dalloul
force-pushed
the
remaining-quota-honest-panel
branch
from
October 11, 2026 15:17
3b55c9f to
cf69039
Compare
This was referenced Oct 11, 2026
The account migration is now m20261017_000001_agent_account and is registered last, after the four migrations v0.36.0 shipped. A backup records only the last registered migration, and a release restores any backup whose last migration it knows. With the account migration in the middle of the list, a backup from this build named m20261016_000002_conversation_assistant, so v0.36.0 restored it and then failed to start, since it has no file for the account migration. Now v0.36.0 refuses such a backup as coming from a newer version. A database that already ran a build with the old name must have its seaql_migrations row renamed to the new one.
The locale files now differ from main only by this branch's own strings. Merging v0.36.0 had moved four of main's blocks to the end of their sections in all ten locales: MentionPanelSettings, WindowAttentionSettings, and AcpAgentSettings' kiro and distribution. No string was lost, but every locale conflicted with later changes next to those blocks, and keeping main's side of a conflict listed kiro twice.
Kiro's and ZCode's settings showed the server's English reason, "Named accounts are not yet supported for this agent.", in every locale. The accounts card now shows a translated note for any built-in agent without accounts, and keeps the OpenClaw gateway note.
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.
Remaining usage follows the account saved on the conversation. Switching a Claude chat updates its usage indicator in the same tab, while Token Usage lists accounts and usage windows separately. Agent mentions can select a native account, such as
Claude Code · Work, and delegated children retain that account when resumed.Stacks on #919; merge that first. This refresh includes main
2e657facand the maintainer's migration-order, locale-order and translated unsupported-agent fixes. It retains the new unified session-settings picker, Claude Remote Control, TRAE CLI and Command Code. This consolidates the earlier panel, header, Cursor and OpenCode Go work from #472, #481, #490 and #491.Usage reads cover Claude, Codex, Grok, Cursor and OpenCode Go through their official usage interfaces. Named accounts use their own credentials. API/provider overrides do not borrow an old subscription balance. Tighter Claude model limits appear separately, OpenCode Go is labelled explicitly, and missing usage stays unavailable.
The account picker retains a chat's model and mode when switching to an unused account, shows loading/retry states, and offers existing-chat switching on top-level Claude conversations. Remote Control must be turned off before switching, with both a localized UI hint and a backend check that preserves the active connection. Remote Control actions wrap with 44px touch targets on narrow screens. Connecting chats use their own account's cached selectors. These preference and Remote Control fixes are also in #919 so it works independently.
The
@menu derives accounts from the registry and retains native icons and types.delegate_to_agentaccepts optionalagent_account_id: omission preserves same-agent inheritance,defaultexplicitly chooses Default, and a saved ID chooses that account. Removed or wrong-agent accounts fail before launch. Identical tasks on different accounts remain distinct, and interrupted children resume their saved account. Custom mentions, stored v3 routing frames, and Assistant presets/instructions remain compatible.Pricing builds on merged #503, included in v0.36.0. The explanation opens by click, tap or keyboard. Partial estimates show how many tokens were priced, unpriced models are labelled, and the explanation states the standard cache-duration assumption and excluded adjustments. These are API list-rate estimates, separate from subscription charges.
Named accounts cover 14 built-in families on Windows/Linux and 13 on macOS. Cursor on macOS uses Default. Kiro, ZCode, TRAE CLI and Command Code retain native agents without named accounts; OpenClaw uses its gateway's account. The account guide and localized backup hint explain that named-account folders need separate backups. OpenCode and Cursor retain the original home/GitHub CLI configuration; other tools using separate configuration folders may need setup.
Validation: 500 focused frontend tests across 19 files, ESLint, TypeScript and production export; the native dependency passes 59 Rust account tests. All 15 focused Rust handshake tests pass after the test-only synchronization fix described below. Runtime fixtures do not perform vendor logins or paid generation.
Separate live checks on Windows verified two distinct existing Claude accounts and authenticated usage reads without changing credentials. No fresh OAuth flow or all-provider sign-in coverage is claimed. OpenCode's installed CLI passed synthetic-store isolation checks while Git, npm and gh retained their configuration; the new OpenCode and Cursor pins were also inspected at source.
The existing
office_watchreleased-port test fix remains: onlyAddrInUsegets a bounded retry with a fresh candidate; other errors and persistent contention still fail. Windows desktop CI compiles tests and runs Clippy without executing that desktop suite. Browser checks use headless Chromium desktop/phone viewports, not native WebViews or physical phones.The final server/MCP build and isolated HTTP/MCP/browser checks pass. They cover native and Assistant mentions, explicit Default and inherited accounts, child/Assistant resume, per-account usage, and switching with history/draft/model/mode retained. Pricing shows $22.05 in the full-rate fixture, $21.75 with 75% coverage when a rate is missing, and no invented zero for an unknown model. Desktop 1365px and phone 390px checks cover usage, price help and backup copy. Remote Control checks at 1365px, 390px and 320px verify direct-API refusal while active, unchanged transcript bytes, visible action bounds, QR interaction and the actual Turn off button before switching. Phone contexts use simulated touch.
The first refreshed native Linux run passed 5,413 tests and exposed an existing handshake fixture race: transport shutdown could cancel its close-notification callback. The notification now follows connection completion, retaining the timeout and all assertions. This changes only test synchronization.
Current-head checks for
364a0727.