Skip to content

fix(google): count Gemini thinking tokens in usage.output_tokens - #2653

Merged
kevinmessiaen merged 3 commits into
mainfrom
chore/format-pr-2622
Aug 17, 2026
Merged

fix(google): count Gemini thinking tokens in usage.output_tokens#2653
kevinmessiaen merged 3 commits into
mainfrom
chore/format-pr-2622

Conversation

@davidberenstein1957

Copy link
Copy Markdown
Contributor

Summary

Formatted follow-up of #2622 (@ebarkhordar).

Same change as #2622, plus ruff format/lint fixes so CI make check can get past format/import sorting.

Why

#2622 was blocked on CI lint (typically check-format on README markdown fences; for some PRs also ruff check import sorting).

Supersedes

Please close #2622 in favor of this PR once CI is green.

Test plan

@kevinmessiaen kevinmessiaen changed the title fix(google): count Gemini thinking tokens in usage.output_tokens 🤖🤖🤖🤖 fix(google): count Gemini thinking tokens in usage.output_tokens Aug 11, 2026
@kevinmessiaen kevinmessiaen added this to the V3-RC milestone Aug 12, 2026
davidberenstein1957 and others added 3 commits August 17, 2026 07:08
Thinking tokens were dropped from the reported output token count, so
usage under-reported cost for thinking-enabled Gemini models.

Original work by @ebarkhordar in #2622.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ebarkhordar

Copy link
Copy Markdown

Thanks for picking this up and landing it, and for the credit line in the commit message. Good to see Gemini thinking tokens counted in usage.output_tokens on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants