Skip to content

Preserve cache token usage when aggregating streaming responses - #7009

Open
Reso777 wants to merge 1 commit into
spring-projects:mainfrom
Reso777:issue-6667-message-aggregator-cache-usage
Open

Reso777 wants to merge 1 commit into
spring-projects:mainfrom
Reso777:issue-6667-message-aggregator-cache-usage

Conversation

@Reso777

@Reso777 Reso777 commented Sep 18, 2026

Copy link
Copy Markdown

Fixes #6667

What does this PR do?

Preserves cache token usage and native usage metadata when aggregating streaming chat responses.

Why is this change needed?

MessageAggregator previously preserved only prompt, completion, and total token counts. Cache read tokens, cache write tokens, and native usage metadata were lost during aggregation.

Testing

  • Added a regression test for cache token and native usage preservation.
  • MessageAggregatorTests passed.

@Reso777 Reso777 changed the title Signed-off-byPreserve cache token usage when aggregating streaming responses Preserve cache token usage when aggregating streaming responses Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MessageAggregator loses cacheReadInputTokens/cacheWriteInputTokens in streaming

2 participants