feat(langchain): Record cached token usage attributes - #7132
Merged
Conversation
alexander-alderman-webb
marked this pull request as ready for review
August 7, 2026 10:01
Contributor
Codecov Results 📊✅ 99560 passed | ⏭️ 6671 skipped | Total: 106231 | Pass Rate: 93.72% | Execution Time: 341m 48s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 97.96%. Project has 2502 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.02% 90.02% —%
==========================================
Files 193 193 —
Lines 25020 25061 +41
Branches 9032 9058 +26
==========================================
+ Hits 22521 22559 +38
- Misses 2499 2502 +3
- Partials 1434 1439 +5Generated by Codecov Action |
This was referenced Aug 7, 2026
Closed
ericapisani
approved these changes
Aug 7, 2026
Base automatically changed from
webb/langchain/stop-double-counting-candidate-tokens
to
master
August 10, 2026 09:23
6 tasks
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.
Description
Limit support for cached tokens counts to values in the provider agnostic
UsageMetadatadictionaries.If values are in the agnostic dictionary, prefer these for all token types.
Issues
Contributes to #6799
Reminders
uv run ruff.feat:,fix:,ref:,meta:)