Add cache-write tokens to the raw response schema (#33500)

## What changed

Add `cacheWriteInputTokens` to the usage breakdown in the
`rawResponse/completed` JSON schema, defaulting it to zero. Update the
compaction and turn-start notification expectations for the expanded usage
breakdown.

GitOrigin-RevId: d9232b724d646b803c7f5a64c5daa311f77ad408
This commit is contained in:
Adam Perry @ OpenAI
2026-07-16 04:45:05 +00:00
committed by copyberry
parent 800715d201
commit 1d941253e9
3 changed files with 7 additions and 0 deletions
@@ -3,6 +3,11 @@
"definitions": {
"TokenUsageBreakdown": {
"properties": {
"cacheWriteInputTokens": {
"default": 0,
"format": "int64",
"type": "integer"
},
"cachedInputTokens": {
"format": "int64",
"type": "integer"
@@ -345,6 +345,7 @@ async fn thread_compact_start_triggers_compaction_and_returns_empty_response() -
total_tokens: 200,
input_tokens: 200,
cached_input_tokens: 0,
cache_write_input_tokens: 0,
output_tokens: 0,
reasoning_output_tokens: 0,
}),
@@ -856,6 +856,7 @@ async fn turn_start_emits_raw_response_completed_with_upstream_usage() -> Result
total_tokens: 37,
input_tokens: 30,
cached_input_tokens: 11,
cache_write_input_tokens: 0,
output_tokens: 7,
reasoning_output_tokens: 3,
}),