Repository navigation
Conversation
Locale.number() formats the thousands value with toFixed(1), so counts from 999,950 to 999,999 rounded to 1000.0 and rendered as "1000.0K". The >= 1000000 branch could not promote them because the count itself is still below a million. It shows up in the TUI context indicator on ~1M context models as "1000.0K (100%)". Roll over at 999,950 instead, the point where one-decimal rounding first reaches 1000.0K, so those counts render as "1.0M". Closes anomalyco#33947
3 tasks done
3 tasks done
Contributor
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
This was referenced Oct 15, 2026
Closed
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.
Issue for this PR
Closes #33947
Type of change
What does this PR do?
Replaces #39407, which was closed by the automated cleanup rather than by a fix. Rebased on current
dev;Locale.number()is unchanged there, so the bug is still live.Locale.number()formats the thousands value withtoFixed(1), so any count from 999,950 to 999,999 rounds to1000.0and renders as1000.0K. The>= 1000000branch never gets a chance to promote it, because the count itself is still below a million. It shows up in the TUI context indicator on ~1M token context models, e.g.1000.0K (100%).Rolling over at 999,950 — the point where one-decimal rounding first reaches
1000.0K— makes those values render as1.0M. Nothing below that boundary changes.How did you verify your code works?
test/util/locale.test.ts: 999,949 still formats as999.9K, 999,950 and 999,999 now format as1.0M, and the existing plain/K/M cases are covered so the fix can't regress them. 4/4 pass,bun typecheckclean.No screenshot — reproducing it in the UI needs a session grown to ~999,950 tokens, so the boundary is covered by the unit test instead.
Checklist