Skip to content

Paid plan: show the plan and the monthly allowance in the App - #188

Merged
longzhi merged 4 commits into
mainfrom
claude/plan-ui
Oct 25, 2026
Merged

longzhi merged 4 commits into
mainfrom
claude/plan-ui

Conversation

@longzhi

@longzhi longzhi commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Closes #180. Part of second-state/vibebuddy-cloud#16 (ADR-0020, #179).

Based on claude/account-usage (#178), which isn't merged yet; retarget to main once it is.

What changes

Daemon. /v1/status account gains plan, as the service's GET /v1/account gives it: {"name":"free"}, or {"name":"paid","period_end":…,"characters":…,"characters_limit":…}. It's read wherever today's usage is read (sign-in, POST /v1/account/refresh) and pushed on the status stream. On the Paid plan, each reply spoken through the service (/v1/voice/speak answering 200) adds its text's length in UTF-16 code units, as the service counts it (JS length), while the month is below its limit; the reply that crosses it counts, later ones go to the daily replies as on the service. Free counts nothing here.

Apps (Mac and Linux). The Account tab shows "Free" or "Paid plan" under the account name, and on Paid "This month: 12,300 of 100,000 characters · renews 24 Nov" (grouped numbers, the renewal date in local time; 11月24日 in Chinese). The daily line stays. No Upgrade button. Strings in the shared zh-Hans table; docs/app.md updated.

Checked

  • cargo test --workspace: all pass, including a new daemon test (Free parsed and serialized as {"name":"free"} with nothing counted; Paid parsed; "café 😀" counted as 7; the crossing reply counted and the next not; signed out shows no plan) and a Linux status test (decoding, Free has no month line, the line's wording and grouping).
  • cargo clippy --all-targets --workspace: no warnings in the touched files.
  • swift build --package-path app and swift run --package-path app SelfTest: pass, with Free and Paid plan decoding checks.
  • python3 tools/check-localization.py: ok, 332 keys.
  • Not checked by hand: neither App was clicked through, and nothing was tried on staging with a hand-set plan row (the issue's third criterion).

🤖 Generated with Claude Code

longzhi and others added 3 commits October 24, 2026 10:10
The daemon keeps today's use from the service (read at sign-in and when
the App opens the tab, POST /v1/account/refresh), counts each command
the voice service recognizes, and remembers an allowance or global-cap
refusal until the UTC day ends; /v1/status carries both. Both Apps show
"Voice today: 7 of 100", or why voice is refused until midnight UTC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The daemon reads the account's plan from GET /v1/account wherever it
reads today's usage (sign-in, POST /v1/account/refresh), and on the
Paid plan counts each reply spoken through the service against the
month, in UTF-16 code units as the service does, until the limit is
crossed. /v1/status `account` gains `plan`. Both Apps show "Free" or
"Paid plan", and on Paid "This month: 12,300 of 100,000 characters ·
renews 24 Nov"; the daily line stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 24, 2026 09:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@longzhi
longzhi changed the base branch from claude/account-usage to main October 25, 2026 08:24
@longzhi
longzhi merged commit 033a6e0 into main Oct 25, 2026
2 checks passed
@longzhi
longzhi deleted the claude/plan-ui branch October 25, 2026 08:25
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.

Paid plan: show the plan and the monthly allowance in the App

2 participants