You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compact number formatter shows "1000.0K" instead of "1.0M" near 1M #33947
Locale.number() (the TUI compact count formatter in packages/tui/src/util/locale.ts) rounds the thousands value with toFixed(1), so counts from 999,950 to 999,999 render as 1000.0K instead of rolling over to 1.0M. It is user-visible in the TUI context/token displays (and the CLI run summary) for a session approaching a 1,000,000-token context window, e.g. 1000.0K (100%).
Steps to reproduce
Use a model with a ~1,000,000-token context window.
Grow a session's token usage into the 999,950-999,999 range.
The context indicator shows 1000.0K instead of 1.0M.
Taking this one if nobody's on it. The K branch formats num / 1000 with toFixed(1), so anything from 999,950 up rounds to 1000.0K before the >= 1000000 check can promote it to M. Fix is to roll over at 999,950 — the point where one-decimal rounding reaches 1000.0K — so those values format as 1.0M. Sending a PR with a unit test shortly.
Activity
Hotragn commentedon Jul 28, 2026
Taking this one if nobody's on it. The
Kbranch formatsnum / 1000withtoFixed(1), so anything from 999,950 up rounds to1000.0Kbefore the>= 1000000check can promote it toM. Fix is to roll over at 999,950 — the point where one-decimal rounding reaches 1000.0K — so those values format as1.0M. Sending a PR with a unit test shortly.fix(tui): roll over compact counts to M at 999,950
fix(tui): roll over compact counts to M at 999,950
github-actions commentedon Sep 27, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.