Skip to content

Conversation

@ethanndickson
Copy link
Member

During streaming, liveUsage (context window display) showed 0 cache creation tokens because it wasn't receiving providerMetadata. The cache creation token count is Anthropic-specific and only available in providerMetadata.anthropic.cacheCreationInputTokens, not in the standard LanguageModelV2Usage.

Thread step-level providerMetadata from backend through IPC to frontend, mirroring the existing pattern for cumulative provider metadata.

The bug was masked after message completion because the UI falls back to lastContextUsage (from persisted metadata) when liveUsage is undefined.

Generated with mux

…display

During streaming, liveUsage (context window display) showed 0 cache creation
tokens because it wasn't receiving providerMetadata. The cache creation token
count is Anthropic-specific and only available in providerMetadata.anthropic.
cacheCreationInputTokens, not in the standard LanguageModelV2Usage.

Thread step-level providerMetadata from backend through IPC to frontend,
mirroring the existing pattern for cumulative provider metadata.

_Generated with mux_
@ethanndickson ethanndickson force-pushed the fix-live-usage-context-updates branch 3 times, most recently from ae461da to 23570df Compare December 3, 2025 04:11
…tion

Cover the fix to prevent regression:
- StreamingMessageAggregator: test step providerMetadata storage/retrieval/clear
- displayUsage: test cacheCreationInputTokens extraction from providerMetadata

_Generated with mux_
@ethanndickson ethanndickson force-pushed the fix-live-usage-context-updates branch from 23570df to 038b236 Compare December 3, 2025 04:11
@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ethanndickson ethanndickson added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit 44964a3 Dec 3, 2025
18 of 19 checks passed
@ethanndickson ethanndickson deleted the fix-live-usage-context-updates branch December 3, 2025 04:34
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.

1 participant