Conversation
sakmist
commented
Sep 29, 2026
Contributor
The /quota JSON endpoint existed but nothing surfaced it — neither the TUI panel nor the CLI showed remaining plan quota. Add a Quota card to the TUI (per-model remaining/total + expiry, `r` key or card button to refresh, fetched once automatically after login) and a `zcode-proxy quota` subcommand that prints balances, claimable plans and upstream errors. Both surfaces reuse collectQuotaSnapshot, so no new upstream request path is introduced. The card sizes its row count to the terminal height so it cannot push the Logs card or footer off-screen, and refreshes only on demand — the billing gateway rate-limits frequent queries.
feat(quota): show plan balances in the TUI panel and a `quota` CLI
Contributor
Author
Owner
|
你看commit 61c086e能不能去掉,这样把tag给打回2.2.0了 |
Owner
|
这个 PR 的额度显示只解算了 zcode-plan/billing/balance 这一个「积分桶」平面(体验套餐/积分制套餐走的就是它),v2 次数制的 coding-plan 配额完全无法解算——官方客户端对这类套餐用的是另一个端点(/api/monitor/usage/quota/limit),PR 根本没接。另外发现一个合并 blocker:贡献者 fork 上的 release 机器人把版本号从 4.7.1 改写成了 2.2.0,合并即版本倒退。 |
Owner
|
另外,
|
Contributor
Author
|
coding-plan没开()没号测 |
Contributor
Author
|
其他几个问题我改一下 |
Owner
|
已合并 @sakmist 的功能提交到 master:974cf83 合并时剔除了 fork 上 release 机器人产生的 61c086e("chore(release): bump version to 2.2.0")——该提交会把 审计遗留跟进(不阻塞):
|
Owner
|
剩下的我来 |
Contributor
Author
|
好 |
TriDefender
added a commit
that referenced
this pull request
Sep 29, 2026
Mirror the official desktop panel's two-plane split in the quota snapshot:
- credits plane (existing): zcode-plan billing/balance + preview with the
plan JWT — start-plan/trial credit buckets;
- coding plane (new): GET {api.z.ai|open.bigmodel.cn}/api/monitor/usage/
quota/limit with the raw coding-plan API key in `authorization` (bundle
wK/Z_ + md) — data.level + data.limits[] windowed usage rows, surfaced
as a Coding group in the TUI card and in the `quota` CLI / GET /quota.
Behavior fixes from the PR #56 audit:
- a credential without a plan JWT no longer kills the snapshot — credits
plane degrades to a noted error while the coding plane still resolves
(the card no longer tells logged-in users they are not logged in);
- coding rows render `remaining` only: live data shows upstream `number`
is not a comparable total (TIME_LIMIT remaining=3894 / number=1), and
the official panel likewise never renders X/Y for these windows;
- envelope success semantics mirror the bundle $_ (success !== false and
code absent/0/200); monitor failures degrade to codingPlan=null the way
the official fetchQuota().catch(() => null) does;
- non-token unitType on balance rows is now visible instead of dropped;
- empty-everything state reworded ("no quota entries reported by
upstream").
@see _reverse/NOTEPAD.md "coding-plan 用量平面"
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.