-
Notifications
You must be signed in to change notification settings - Fork 2k
z.ai: add 7-day / 30-day ranges to the model-usage chart (needs a daily-granularity fetch) #2523
Copy link
Copy link
Closed
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Activity
Metadata
Metadata
Assignees
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Summary
The z.ai Hourly Usage chart (from
api/monitor/usage/model-usage) currently offers Today and 24h ranges (hourly bars). The BigModel/z.ai dashboard also offers 近7天 / 近30天 (7-day / 30-day) views. This proposes adding 7-day and 30-day ranges to CodexBar's chart.Key finding (affects the implementation shape)
The
model-usageendpoint returns granularity by span:xTimelike"2026-07-31 14:00";xTimelike"2026-07-01"(verified live:startTime=2026-07-02 00:00:00&endTime=2026-07-31 23:59:59→ 31 daily points).So 7d/30d cannot be derived from the existing 1-day/hourly snapshot data — they need a separate daily-granularity fetch (a wider
startTime/endTime), and the chart needs to render daily bars (date labels) for those ranges alongside the existing hourly bars.Proposed shape
ZaiHourlyRangewith.last7d/.last30d; render daily bars (parse"yyyy-MM-dd", labelMM-dd) for those, hourly bars for Today/24h.ZaiHourlyUsageChartMenuView.Cost: one extra
model-usagerequest per refresh (the daily window). No new endpoint or auth.I'll send a PR.