Fix menu bar layout not showing provider balance - #3494
Conversation
The layout render path only wired the automaticText override for Mistral, so DeepSeek's synthetic balance window rendered as a meaningless quota percent (100% remaining / 0% used) instead of the balance that the legacy path shows. Share the override helper, let DeepSeek supply its balance text, and prefer automaticText over the automatic lane percent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed September 8, 2026, 3:48 AM ET / 07:48 UTC. ClawSweeper reviewWhat this changesThe PR shares provider balance extraction across legacy menu-bar text, saved layouts, and editor previews, while retaining real quota percentages and adding tests and documentation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain The fix remains necessary and has convincing native proof, but the previously reported DeepSeek combined-layout duplication remains unresolved. The DeepInfra quota regression is fixed, and the description now identifies the reviewed head. Priority: P2 Review scores
Verification
How this fits togetherCodexBar turns provider usage snapshots into configurable menu-bar text and editor previews. The automatic token chooses between a quota percentage and provider-specific money or points. flowchart TD
A[Provider usage snapshot] --> B[Automatic window selection]
A --> C[Shared balance extraction]
B --> D[Quota or balance decision]
C --> D
D --> E[Layout token renderer]
E --> F[Menu bar status item]
E --> G[Editor preview]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Render an automatic balance once in combined layouts while preserving reset-only balance visibility, real quota percentages, and stored layout preferences. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the original default-layout omission and the remaining combined-layout defect: a funded DeepSeek snapshot with percentAndReset supplies the same compact balance to both tokens. No reviewer-side runtime tests were executed. Is this the best way to solve the issue? The shared extraction is the appropriate narrow fix, but the renderer must also handle the existing combined preset without duplicating the balance. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c3f3ea1faf70. LabelsLabel justifications:
EvidenceAcceptance criteria:
What 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
HistoryReview history (4 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1d2319c97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if window == .automatic, let automaticText { | ||
| // Balance-only providers (e.g. DeepSeek) send a valid window whose percent is meaningless; | ||
| // the resolved text is the balance they should surface instead. | ||
| return (automaticText, true) |
There was a problem hiding this comment.
Avoid duplicating balance in percent-and-reset layouts
For DeepSeek, the automatic window's resetDescription is already normalized to the same compact balance used by automaticText. Consequently, the shipped percentAndReset preset (.percent(.automatic) · .resetCountdown) now renders values such as ¥100.00 · ¥100.00; the same duplication affects equivalent custom layouts. The override should avoid causing both tokens to surface the identical balance, for example by suppressing the reset value when it is serving as the automatic-percent replacement.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed, with context: before this PR the reset token was the only place the layout path surfaced DeepSeek's balance at all — for balance-only providers resetDescription doubles as the balance detail, so the pre-fix percentAndReset preset already rendered 100% · ¥100.00 (Paid: …). After this change both tokens show balance text: redundant, but strictly more informative than the fake 100%, and the full breakdown string differs from the compact percent-token text.
Suppressing the reset value would require the renderer to reason about sibling tokens, and risks hiding the balance entirely in reset-only layouts, where the reset token is the only balance surface. Leaving the token-pairing question to the maintainer — happy to implement whichever direction is preferred in a follow-up.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
I’m preparing this for landing. The missing balance wiring is reproducible in both the status-item and editor data builders. I’m consolidating the existing extraction logic so those paths and legacy display share it, preserving real-quota priority and the existing provider-specific preference rules. I’ll add native before/after proof and the changelog entry before landing. Thanks @zkforge! |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Preserve actual quota percentages while showing balance-only money and points in the automatic layout. Reuse extraction across legacy display, status-item data, and editor previews, removing duplicate branches and wrappers. Add isolated native proof and regression coverage. Co-authored-by: Zhou Kai <kaizhou0305@gmail.com>
|
Thanks for the DeepInfra spending-limit follow-up. I’ve incorporated that behavior into the shared resolver and added editor-preview coverage alongside the status-item regression. The maintainer refactor remains net negative in production code (-33 lines). The push correctly stopped because your branch advanced. I’m completing the merge review and final suite before pushing the integrated commits; the PR body and native screenshots currently describe that prepared candidate, not yet the branch head. The native DeepSeek/Poe/OpenRouter proof paths are unchanged by the DeepInfra correction. |


Fixes #3492.
The default icon + automatic-percent layout omitted balance/spend text already supported by legacy display. DeepSeek and DeepInfra consequently showed meaningless percentages; providers with no quota window showed a dash despite available money or points.
Share balance extraction between legacy display, the actual status-item data builder, and the layout editor's live-data builder. Automatic text takes precedence for balance-only windows; providers with usable quota limits retain percentages, including DeepInfra billing-cycle spending limits. Explicit session/weekly tokens, OpenRouter's legacy preference rules, Mistral monthly plans, MiMo selection, and Kiro display modes retain their existing behavior. Remove the duplicated provider branches and obsolete wrappers: production LOC is net -33. Includes changelog and UI documentation. Thanks @zkforge!
The isolated native proof uses Developer ID-signed baseline/candidate test bundles on macOS 26.6.2 (25G83), dictionary-backed defaults, in-memory credential stores, a synthetic home/config, and no provider transports. It feeds synthetic usage snapshots through the real stored-status-item application method and hosts the actual editor preview view.
The native editor baseline shows DeepSeek as 100% and Poe as unavailable. The candidate shows ¥100.00 and 512 points. OpenRouter remains a real 75% remaining quota. Zero-balance and show-used checks also passed: DeepSeek stays monetary, Poe stays in points, and only the real quota switches to 25% used. Actual status-item accessibility output and width receipts agree with those values. Screenshots below show the native editor proof.
Before:

After:

Zero balance and show-used control:

Validation: 149 focused balance, renderer, and architecture tests passed. The final full make test run passed all 1,036 selections across 87 groups on the first pass, with no retries or timeouts. make check and independent P0–P2 review passed. CI for commit 325f1d1 is pending.