fix(cloud-agent-next): round session usage to two decimals - #6046
Merged
Conversation
Show Token Usage as dollar cents instead of four-decimal amounts, and hide totals that round to $0.00.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummarySession Token Usage rounding was scaled from four decimals to cents with matching hide-below-half-cent thresholds; tests cover the new precision and I found no correctness issues. Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 102.7K · Output: 10.8K · Cached: 132.9K Review guidance: REVIEW.md from base branch |
iscekic
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Cloud Agent Token Usage on the web was shown to four decimal places (e.g.
$1.2346). Round it to cents ($1.23) so session usage matches ordinary dollar display.formatSessionCostnow uses two-decimal half-up rounding$0.00Verification
session-cost-breakdown.test.tsandChatHeader.test.ts(96 tests) passed via Jest without the PostgreSQL worker setupVisual Changes
Token Usage in the chat header and session info dialog now shows
$1.23instead of$1.2346. Totals under$0.005no longer appear.Reviewer Notes
Per-message API request costs still use four decimals; only session Token Usage is two decimals.