Repository navigation
Description
Area
Multiple areas
What are you trying to accomplish?
Display WorkBuddy's aggregated credit percentage accurately when package balances lie extremely close to a whole-percent rounding boundary.
What prevents this today?
WorkBuddy package values are aggregated and exposed as JavaScript numbers. Converting an aggregate to a number can erase a decimal distinction immediately below a half-percent boundary. The dashboard's indicator is informational and uses neutral severity, but the displayed rounded value can differ by one percentage point at such a boundary.
What should OpenCodex do?
Preserve enough precision through provider aggregation, quota transport and dashboard normalization to distinguish exact ties from values just below them. Keep existing numeric DTO fields compatible, validate bounded input, and avoid using this informational balance for routing or account eligibility.
Example usage or interface
For two packages with totals 0.5 and 0.5, and remaining values 0.4975 and 0.49750000000000005, the exact remaining sum is 0.99500000000000005. The unavailable share is just under 0.5% and should display 0%; an exact 0.995 remaining balance is a tie and should display 1%.
Alternatives or workarounds
The current numeric projection is sufficient for ordinary balances and does not affect routing. A bounded optional pair of exact decimal strings for total and remaining could accompany the existing numeric fields; preserve older numeric-only responses and reject malformed or inconsistent exact metadata.
Additional context
Follow-up to #8131 and PR #8323. Consider whether exact values are needed for used, frozen and group totals as well, including enterprise fallback and subnormal values. Ordinary JSON.parse can already lose the original precision of an unquoted numeric token, so a design claiming exact input preservation must account for the parsing boundary; quoted decimal values can retain their text. Bound digit count, scale, exponent, package and group counts before arbitrary-precision arithmetic, and test DTO/cache round trips, malformed values and below-half/tie/over-total cases.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
coderabbitai commentedon Nov 8, 2026
🔗 Related PRs
#7604 - feat(workbuddy): add subscription and credit support [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
fix(workbuddy): keep quota change within display scope
fix(gui): show WorkBuddy credit balance in quota bar (#8323)
shu-chen-dot-ca commentedon Nov 9, 2026
I'm taking this one on.