Add DeepSeek rolling usage metrics - #2894
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 11:07 PM ET / August 13, 2026, 03:07 UTC. ClawSweeper reviewWhat this changesThe PR adds optional five-hour and seven-day DeepSeek token and spend totals using private Platform dashboard usage endpoints. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this draft PR open: it introduces a real multi-currency display defect and lacks after-fix proof from a DeepSeek Platform session. Priority: P3 Review scores
Verification
How this fits togetherCodexBar’s DeepSeek provider combines a Platform session with monthly usage data to render detail rows in the menu bar. This PR adds four rolling-window requests, aggregates their responses, and sends the resulting totals to the same detail-row renderer. flowchart LR
A[DeepSeek Platform session] --> B[Monthly usage requests]
A --> C[Rolling usage requests]
B --> D[Monthly usage summary]
C --> E[Rolling usage parser]
D --> F[Menu detail rows]
E --> F
F --> G[CodexBar menu]
Decision needed
Why: The endpoints are a new user-visible dependency on a private dashboard contract, so correctness alone cannot establish whether this provider surface should be maintained. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve one explicit currency contract for rolling and monthly spend, add multi-currency regression coverage, then attach redacted live menu or terminal proof from a real Platform session. Do we have a high-confidence way to reproduce the issue? Yes for the currency defect: the parser accepts multiple currency groups, production passes it no preference, and the renderer uses the separate monthly currency field. Is this the best way to solve the issue? No: the current path loses each rolling result’s currency before display; retaining or explicitly selecting that currency is the narrower safe solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 208016687098. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
Implementation notes
DeepSeek's documented public API exposes account balance, but not rolling usage windows. The additional totals use the private Platform dashboard's
usage/by_api_key/amountandusage/by_api_key/costendpoints with exact Unix timestamp ranges. Responses are aggregated across API keys, models, and time buckets.These values are absolute rolling totals. DeepSeek does not provide quota denominators or reset timestamps, so they are intentionally rendered as detail rows rather than percentage-based rate-limit bars.
The four rolling requests run concurrently and have their own bounded join. Missing, failed, or slow rolling responses degrade independently and do not discard the existing monthly detail response.
Tests
swift test --filter DeepSeek— passed (121 tests; one screenshot proof skipped unless its output directory is configured)make check— passed (0 SwiftLint violations in 1,848 files)make test— 60 groups passed; theStatusMenuTestsgroup failed onmerged data tick keeps row count and card views stable(menu.items.count18 vs. 16). The same failure reproduces in an isolated rerun with only Codex and Claude enabled; it does not exercise DeepSeek code.