Repository navigation
fix: normalize token usage to avoid double counting - #2653
Closed
spoons-and-mirrors wants to merge 2 commits into
Closed
spoons-and-mirrors wants to merge 2 commits into
spoons-and-mirrors wants to merge 2 commits into
Conversation
Member
|
hmm this logic was originally implemented with anthropic and i don't recall this calculation being how they returned things. we had to add everything up |
Contributor
Author
|
Shoot, will fix soon ! |
spoons-and-mirrors
force-pushed
the
fix/token-count
branch
2 times, most recently
from
September 23, 2025 19:42
7a284a8 to
e7cc226
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
September 29, 2025 05:53
f16de3d to
cc0d460
Compare
spoons-and-mirrors
force-pushed
the
fix/token-count
branch
from
October 9, 2025 15:45
e7cc226 to
4e237a0
Compare
revert fix: Implement provider-specific token calculation to fix double counting fix: making openai compatible calculation the default one, with specific case for anthropic and bedrock
spoons-and-mirrors
force-pushed
the
fix/token-count
branch
from
November 6, 2025 17:25
4e237a0 to
b412c37
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
November 10, 2025 05:42
772b621 to
eb855e1
Compare
Member
|
Please merge this compacting twice as often is terrible UX! |
Contributor
Author
|
closing this PR as 1.0.62 fixed the token count :) |
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
Deducts
cachedInputTokensfrominputTokensandreasoningTokensfromoutputTokensinSession.getUsageto prevent double counting across providers.