-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[MiMo] Usage percentage truncated to 0% for values under 1% #1734
Copy link
Copy link
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.no-staleExempts this issue from stale automation.Exempts this issue from stale automation.
Description
Metadata
Metadata
Assignees
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.no-staleExempts this issue from stale automation.Exempts this issue from stale automation.
Bug Description
MiMo token plan usage percentage is displayed as 0% used in the menu bar when the actual usage is between 0% and 1% (e.g., 0.96%). The Xiaomi MiMo console correctly shows 1% (rounded up), but CodexBar truncates to integer.
Root Cause
In UsageFormatter.usageLine(), the format string "%.0f%% %@" truncates the percentage to zero decimal places. For MiMo's 38B token plan, 0.96% usage (363M / 38B) is displayed as % used instead of 1% used or .96% used.
swift // Current code in UsageFormatter.swift return String(format: "%.0f%% %@", clamped, suffix)Expected Behavior
Suggested Fix
Option A: Round to nearest integer:
swift let rounded = clamped.rounded() return String(format: "%d%% %@", Int(rounded), suffix)Option B: Show one decimal place when under 10%:
swift let format = clamped < 10 ? "%.1f%%" : "%.0f%%" return String(format: "\(format) %@", clamped, suffix)Environment