Cache-write tokens are counted as ordinary input
Summary
Codex app-server reports inputTokens inclusive of both cache reads and cache writes. codex-acp currently subtracts cachedInputTokens, but not cacheWriteInputTokens, and does not populate ACP's cachedWriteTokens field at all.
As a result, cache writes are reported as ordinary input and the cache-write count is lost.
Example
Given this Codex usage:
inputTokens: 100
cachedInputTokens: 40
cacheWriteInputTokens: 30
outputTokens: 10
reasoningOutputTokens: 5
totalTokens: 110
Current ACP usage:
inputTokens: 60
cachedReadTokens: 40
cachedWriteTokens: missing <---
outputTokens: 10
totalTokens: 110
Expected ACP usage:
inputTokens: 30
cachedReadTokens: 40
cachedWriteTokens: 30
outputTokens: 10
totalTokens: 110
reasoningOutputTokens remains a subset of outputTokens and is not added to the total again.
Cache-write tokens are counted as ordinary input
Summary
Codex app-server reports
inputTokensinclusive of both cache reads and cache writes.codex-acpcurrently subtractscachedInputTokens, but notcacheWriteInputTokens, and does not populate ACP'scachedWriteTokensfield at all.As a result, cache writes are reported as ordinary input and the cache-write count is lost.
Example
Given this Codex usage:
Current ACP usage:
Expected ACP usage:
reasoningOutputTokensremains a subset ofoutputTokensand is not added to the total again.