Repository navigation
feat(usage): add Overview, Account, and Status panels - #251
Merged
Merged
Conversation
ZouR-Ma
force-pushed
the
feature/usage-overview-account
branch
2 times, most recently
from
October 15, 2026 06:10
1eda90e to
e56ed1a
Compare
ZouR-Ma
force-pushed
the
feature/usage-overview-account
branch
from
October 15, 2026 06:53
e56ed1a to
9211f2c
Compare
Share usage selection, validation, and accumulation with existing session statistics. Remove the duplicate projection module and forwarding facade. Keep activity recording on existing extension hooks, preserve teardown ordering, and reuse ANSI stripping for display labels.
ZouR-Ma
force-pushed
the
feature/usage-overview-account
branch
from
October 15, 2026 11:50
a3c44d8 to
dcf18f2
Compare
ZouR-Ma
requested review from
MelodyVAR,
Uking-xxx and
liuedcson
as code owners
October 15, 2026 11:50
Check personal Plan usage after browser login and during interactive startup. Reuse same-region Platform key entry when a fresh response confirms no subscription or usable top-up credits. Preserve usable top-ups and exhausted-plan logins, report uncertain checks, and cancel pending requests when leaving the login view.
liuedcson
approved these changes
Oct 16, 2026
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.
Problem
Step Code needs an in-terminal view of local activity, personal plan quota, and runtime state. Add
/usagewith Overview and Account tabs and expand the independent/statuscommand. These views use the existing editor area like/settings, keeping the footer below the panel.Changes
core/usage-totals.tsowns entry selection and validation shared by session statistics, Account, and Overview. Activity recording uses existing extension hooks; command parsing and view lifecycle remain separate. No new dependency, event bus, session store, or background polling is introduced.ctx.ui.customin its default inline mode: full terminal width, editor replacement, retained footer, and draft/focus restoration on Esc. Real host/terminal regressions cover regular/fullscreen modes and resizing. Node/Bun packaging includes the activity worker.Behavior and compatibility
Supported forms are
/usage,/usage overview,/usage account,/usage --refresh, and/usage account --refresh. Session and History are not separate tabs or commands. Model/gateway keys, platform profiles, and unknown profiles do not issue personal quota requests.Activity scans do not migrate or rewrite session files. New sessions record statistics/provenance custom entries; fork/export manifests preserve copied usage attribution. Cache projections exclude message bodies, prompts, tool arguments, credentials, and errors. SDK hosts receive typed services and presentation models through existing extension composition. RPC uses its output bridge; other noninteractive consumers use their explicit output sink.
Account and the Plan availability check require schema 1 at
GET /step_plan/v1/usage; each region must deploy that endpoint. HTTP 404 is an explicit deployment state, not evidence of a missing subscription. Overview and Status remain available locally. See account-usage.md for controls and limits, and the rendering pipeline for panel mounting.Review order
The branch is rebased onto
mainatd0ec996. The first ten patches are unchanged by the rebase (git range-diff); subsequent commits align panel mounting and quota presentation with the existing terminal UI.| 14 | fix(auth): guide accounts without a plan to API-key login |
Validation
macOS arm64, Node v24.3.0, pnpm 9.15.9:
pnpm run checkpassed, including types, package/layer boundaries, frozen entry points, secret checks, public-source boundaries, and browser smoke.pnpm run build:offlinepassed for the feature. Before the current full test run,pnpm run buildinpackages/coding-agentrebuilt its library, CLI entry, and Node bundle from current source.TMPDIR=/tmp ./test.shpassed with isolated user resources and no provider credentials: coding-agent 4579 passed / 59 skipped; CLI 692 passed; providers 446 passed / 6 skipped; agent-core 539 passed / 1 skipped; remaining package/script suites passed.apps/cli,pnpm exec vitest --run test/usage-panel.test.ts test/tui-acceptance-snapshot.test.tspassed all 39 tests, including full/partial/exhausted/unknown Credit percentage cases for both Account and Status.pnpm stepandpnpm step --tui-mode fullscreenpassed 30 checks each using an authorized CN TOKEN account. The checks cover local JSONL totals, calendar positions, scope/date controls, live quota fetch/refresh, cached Status, compact percentage bars and absence of raw Credit balances, 80×24 resize/scroll, footer placement, Esc and restored editor input. Both processes exited normally; account-specific evidence stays local.Limitations
CI for the updated head is pending independent confirmation. Tests above establish macOS behavior; live overseas/CODING account integration, additional release platforms, and live terminal performance acceptance remain separate checks. The real-account smoke above covers one CN TOKEN account; other quota states are fixture-tested. Platform monetary bills, organization Credit, and cross-device activity history are outside this feature.