GeezerVison is showing github.com — fix(gui): show WorkBuddy credit balance in quota bar by lidge-jun · Pull Request #8323 · lidge-jun/opencodex
Conversation
lidge-jun
commented
Nov 8, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
WorkBuddy AI can report a valid credit balance yet disappear from the dashboard's top quota bar because credits are not a time window. Show its unavailable share using reported remaining credits, including frozen credits, with neutral severity; do not present a partial expiry as a reset of the whole balance. The display remains informational and does not change routing or account eligibility.
Closes #8131
Reimplements the contributor work carried by #8224.
Verification
- Exact head
d123a6c6171516a20e6b1a202c2b7661cd65e1dd: failing-first regression coverage and isolated temporary-home checks passed: 10 WorkBuddy backend tests; 29 GUI tests; typecheck; test-layout and Lab guards; file-size ratchet; privacy and structure checks; GUI i18n, lint, build and React Doctor 0.9.11. The ratchet initially timed out in a combined run and passed when run alone using the shared test lock, without changing its timeout.
- Fresh independent feature and safety reviews on that exact head found no P0/P1 or correctness/security P2 findings.
- A clean merge-tree with
dev 573c1dc6102d21d23dc2a47b2246d50d530dbf12 was checked in a temporary detached union: focused backend/GUI tests, typecheck, layout/Lab, privacy, structure, GUI lint/build and the ratchet CLI passed. The union ratchet test itself timed out twice at its existing 5-second limit; no limit was changed. After dev advanced to 56d9ab4dbcce0f84279f1aea17a56531133e702d, a new clean merge-tree differed only by devlog documents; privacy and structure passed on that union too.
- The previous broad local
test:changed run was unreliable on this host. Single-file comparisons used the shared test lock and the same isolated outer homes on clean dev 0627a2c and this PR head: API usage passed 34/34 on both; images failed 19 on dev and 25 on the PR (8 names common); native catalog failed 4 on dev and passed 7/7 on the PR; credential-generation failed 15 on dev and 18 on the PR (12 common); local credentials failed 3 on dev and 5 on the PR (3 common). Many failures were timeouts or ownership/fixture cascades; not every differing test was independently attributed. Exact-head hosted ci:full is the broad gate.
- Known limitation: near a half-percent boundary, numeric conversion after aggregating unusually precise mixed package amounts can round the neutral informational percentage by one point. Tracked in Preserve decimal precision for WorkBuddy quota aggregation #8324; it does not affect routing.
- NOT RUN: final-head full root suite /
prepush, live WorkBuddy account or provider requests. The local pre-push hook was bypassed for this branch as instructed; isolated focused checks ran separately as listed.
Synthetic component rendering with production quota-bar styles and no account data:
Before:

After:

Checklist
- Scope stays focused and avoids unrelated cleanup.
- Docs or release notes were updated when needed.
- Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
Co-authored-by: Rafael Moreira Lima [email protected]
Summary by CodeRabbit
- New Features
- WorkBuddy quota summaries now show the percentage of credits that are unavailable, including frozen credits, when the reported total is positive. Percentages are rounded to the nearest whole number.
- Bug Fixes
- Credit balances now retain more accurate values for decimal amounts and large numbers of credit packages.
- Documentation
- Clarified that unavailable-credit percentages are informational and individual credit expiries do not indicate a reset of the full balance.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
coderabbitai
Bot
commented
Nov 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
The change adds decimal-aware WorkBuddy credit aggregation and remaining-balance calculations. It adds an unavailable-credit percentage to the GUI quota summary, including localized labels, tests, and documentation.
Changes: WorkBuddy quota reporting
| Layer / File(s) |
Summary |
Exact credit parsing and balance calculations src/providers/workbuddy-credit-balance.ts, tests/providers/workbuddy-quota.test.ts, structure/providers/workbuddy.md |
Package and credit-group amounts are summed using decimal representations. Missing package remaining amounts use a helper that subtracts used and frozen credits from the total. Tests cover decimal amounts and small values. |
Quota probe integration src/providers/quota/workbuddy.ts, tests/providers/workbuddy-quota.test.ts |
The enterprise quota probe uses the shared remaining-credit helper. Tests check the remaining balance and formatted dashboard percentage for a decimal balance. |
GUI quota summary and presentation gui/src/quota-summary.ts, gui/src/components/quota-summary-bar/QuotaSummaryBar.tsx, gui/src/i18n/*, gui/tests/quota-summary*.test.ts*, docs-site/src/content/docs/guides/providers.md, docs-site/src/content/docs/zh-cn/guides/providers.md, structure/dashboard-and-usage.md |
The GUI adds an unavailable-credit window for valid WorkBuddy balances. It rounds the unavailable percentage to a whole number and uses normal severity. The quota chip displays a localized label. Tests and documentation cover the projection and display. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant WorkBuddyQuotaReport
participant summaryWindows
participant QuotaSummaryBar
WorkBuddyQuotaReport->>summaryWindows: provide WorkBuddy credit balance
summaryWindows->>QuotaSummaryBar: provide unavailable-credit label and percentage
Loading
Possibly related issues
Possibly related PRs
Suggested reviewers: terrytan95
Merge Risk: Minimal · up to d123a
-
No concrete merge-blocking issue is established for the informational WorkBuddy credit display. Merge readiness remains subject to normal checks.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title "fix(gui): show WorkBuddy credit balance in quota bar" matches the main change. The PR adds a WorkBuddy unavailable-credits window to the quota summary bar, with localized labels and tests. … |
| Linked Issues check |
 |
[#8131] Objectives: (1) WorkBuddy AI appears in the top QuotaSummaryBar; (2) its credit status is visible in the summary and popover; (3) the root cause is fixed, namely that summaryWindows() in gui/s… |
| Out of Scope Changes check |
 |
Changes grouped by link to the display objective: 1. Display: gui/src/components/quota-summary-bar/QuotaSummaryBar.tsx (+3 lines), gui/src/quota-summary.ts (+29 lines), and the quotaSummary.creditsUna… |
Full details: Title check
-
Explanation
The title "fix(gui): show WorkBuddy credit balance in quota bar" matches the main change. The PR adds a WorkBuddy unavailable-credits window to the quota summary bar, with localized labels and tests. The title names the subsystem (gui), the provider (WorkBuddy), and the UI surface (quota bar). It is concise and single-sentence. Minor nuance: the change shows the unavailable (frozen or used) share rather than a plain balance, so "credit balance" is slightly broader than the displayed metric, but it still refers to the real primary change.
Full details: Linked Issues check
-
Explanation
[#8131] Objectives: (1) WorkBuddy AI appears in the top QuotaSummaryBar; (2) its credit status is visible in the summary and popover; (3) the root cause is fixed, namely that summaryWindows() in gui/src/quota-summary.ts ignored workbuddyCredits, so pickHeadline() found no window and buildQuotaSummary() skipped the provider.
Implementation at head: summaryWindows() adds a credits-unavailable window from workbuddyCredits when total > 0 and remaining/total <= 1 + Number.EPSILON*1024. Percent = (total - min(remaining,total)) / total, rounded to an integer. Severity is normal. Label key is quotaSummary.creditsUnavailable.
Chip: gui/src/components/quota-summary-bar/QuotaSummaryBar.tsx, diff hunk @@ -209,6 +209,9 @@ adds lines 212-214, which render the label inside the chip before the percent. Popover: the existing popover renders row.windows as a table, so the new window appears there with its label and percent. This meets the popover credit-status objective.
Tests: gui/tests/quota-summary.test.ts (+77) and gui/tests/quota-summary-bar.test.tsx (+25) cover chip rendering, frozen 100%, decimal rounding, malformed and overdrawn omission, and preservation of valid windows.
Deviations from the issue's suggested fix: the percent is the unavailable share, not used/total; severity is neutral; expiry is not used as resetAt. The Expected Behavior allows 'used/remaining percentage or calculated usage severity' (e.g. wording) and does not require expiry. The current PR description states these choices as intent, so they do not fail the requirement.
Uncertainty: quota-summary.ts was assessed from the supplied summary and the bar component diff. The file was not re-read at head.
Full details: Out of Scope Changes check
-
Explanation
Changes grouped by link to the display objective:
- Display: gui/src/components/quota-summary-bar/QuotaSummaryBar.tsx (+3 lines), gui/src/quota-summary.ts (+29 lines), and the quotaSummary.creditsUnavailable key in 11 i18n catalogs (de, en, fr, ja, ko, pt, ru, tr, vi, zh-TW, zh). Directly implements
#8131.
- Tests: gui/tests/quota-summary.test.ts and gui/tests/quota-summary-bar.test.tsx. Supporting tests for item 1.
- Docs: docs-site/src/content/docs/guides/providers.md, docs-site/.../zh-cn/guides/providers.md, structure/dashboard-and-usage.md, structure/providers/workbuddy.md. Document the new quota-summary rule.
- Backend: src/providers/workbuddy-credit-balance.ts and src/providers/quota/workbuddy.ts. Decimal summation in sumCapacities/sumAmounts and parseWorkBuddyCredits, plus new remainingWorkBuddyCredits(total, used, frozen?) used by fetchWorkBuddyQuota. These set the remaining value that the display consumes, so they connect to the objective. Backend tests in tests/providers/workbuddy-quota.test.ts (+26) cover preserved remaining amounts and a 0.285/1 case that formats as 29%.
The parser change that groups credit-group rows by kind before summing alters aggregation beyond the display. The PR description does not justify it separately. It still feeds the remaining value shown by this objective, so no concrete lack of connection is shown.
No routing, eligibility, or provider-probe change appears in the supplied summary. The #8324 rounding limitation is a disclosed follow-up, not new scope.
Uncertainty: the backend parser diff was assessed from the supplied summary, not re-read at head.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 13 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
✅ Deterministic PR hygiene checks passed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Action performed
-
Review finished.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-08T06:14:57.218720Z |
d123a6c |
Draft marked ready |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
Ingwannu
Awaiting requested review from Ingwannu
Ingwannu is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
bug
Something isn't working
ci:full
Run the four full Ubuntu test shards on this pull request
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|