Repository navigation
plugin: carry a rounded token figure into the next unit in te status - #304
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
`fmt_tokens` chose the unit before rounding, so a figure that rounds up to 1000 of its unit was shown in it: 999,950 effective tokens as "1000.0k", 999,999,999 as "1000.0M", and 999.6 (effective tokens are weighted, so they need not be whole) as "1000". The unit is now chosen, then moved up while the figure rounds to 1000 or more of it: those are "1.0M", "1.0B" and "1.0k". Over 28,000 other figures the output is unchanged.
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.
fmt_tokenschose the unit before rounding, so a figure that rounds up to 1000 of its unit was shown in it: 999,950 effective tokens as "1000.0k", 999,999,999 as "1000.0M", and 999.6 (effective tokens are weighted, so they need not be whole) as "1000".Fix: the unit is chosen as before, then moved up while the figure rounds to 1000 or more of it, giving "1.0M", "1.0B" and "1.0k". Over 28,000 other figures, random and every whole number up to 3,000, the output is unchanged, and
None, NaN and negatives read as before.Tests, in a new
tests/test_fmt_tokens.py:The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.
Fixes #300