Track prompt cache write token usage - #33454
Merged
copyberry[bot] merged 1 commit intoJul 16, 2026
Merged
Conversation
## What changed - Parse `cache_write_tokens` from response input token details and carry it through token usage aggregation. - Expose `cache_write_input_tokens` in protocol, app-server, exec, and TypeScript SDK usage events, defaulting it to zero for compatibility with older payloads. - Report cache-write usage in analytics, metrics, traces, and rollout data alongside existing cache-read usage. ## Testing - Add coverage for response parsing, usage event output, aggregation, analytics, metrics, and telemetry fields. GitOrigin-RevId: 634e4fbe3086a8923c0ee13b622573e7d9d221bd
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/634e4fbe3086a8923c0ee13b622573e7d9d221bd
branch
from
July 16, 2026 00:23
376a4f2 to
2edad72
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/634e4fbe3086a8923c0ee13b622573e7d9d221bd
branch
July 16, 2026 00:24
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Track prompt cache write token usage
What changed
cache_write_tokensfrom response input token details and carry it through token usage aggregation.cache_write_input_tokensin protocol, app-server, exec, and TypeScript SDK usage events, defaulting it to zero for compatibility with older payloads.Testing