Skip to content

fix(adk): align Google usage token totals - #649

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-adk-token-align
Aug 4, 2026
Merged

fix(adk): align Google usage token totals#649
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-adk-token-align

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Aug 4, 2026

Copy link
Copy Markdown
Member

resolves https://linear.app/braintrustdata/issue/SDK-110/adk-align-google-usage-metadata-token-metrics

ADK traces omitted tool-use prompt tokens from prompt totals and reasoning tokens from completion totals. Customers using Google Search or reasoning models therefore saw token breakdowns that disagreed with Google's reported total, making usage analysis and provider reconciliation misleading.

Keep the normalized breakdown consistent with the provider total:

prompt + tool-use prompt + candidates + thoughts = total

Retain reasoning and tool-use details so customers can still inspect where the aggregate usage came from. Cover both supported ADK versions with real Google Search recordings.

ADK traces omitted tool-use prompt tokens from prompt totals and reasoning
tokens from completion totals. Customers using Google Search or reasoning
models therefore saw token breakdowns that disagreed with Google's reported
total, making usage analysis and provider reconciliation misleading.

Keep the normalized breakdown consistent with the provider total:

  prompt + tool-use prompt + candidates + thoughts = total

Retain reasoning and tool-use details so customers can still inspect where
the aggregate usage came from. Cover both supported ADK versions with real
Google Search recordings.
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 9d41f64 into main Aug 4, 2026
82 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi-adk-token-align branch August 4, 2026 16:59
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) linked an issue Aug 4, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adk align Google usage metadata token metrics

2 participants