83b60990d2
Verify typed ThreadTokenUsage/TokenUsageBreakdown/Thread/Turn against openai/codex@6fb1c3903d. Use native totalTokens and latest-call context tokens without re-adding cached/reasoning subsets. Replay bounded per-connection snapshots and clear on room/source release. Cost stays unavailable: no subscription USD usage is reported by this notification. Throughput stays unavailable even with native Turn.durationMs because neither last-call nor cumulative-session output is a compatible turn-specific numerator. Thread readback exposes no token usage; no extra reads, resume, or live provider calls added. Checks: go test -race ./internal/codex; go vet ./internal/codex; go test ./internal/server ./internal/protocol; git diff --check.
27 lines
626 B
JSON
27 lines
626 B
JSON
{
|
|
"method": "thread/tokenUsage/updated",
|
|
"params": {
|
|
"threadId": "thread",
|
|
"turnId": "turn_new",
|
|
"tokenUsage": {
|
|
"total": {
|
|
"totalTokens": 12000,
|
|
"inputTokens": 10000,
|
|
"cachedInputTokens": 7000,
|
|
"cacheWriteInputTokens": 1000,
|
|
"outputTokens": 2000,
|
|
"reasoningOutputTokens": 1500
|
|
},
|
|
"last": {
|
|
"totalTokens": 3500,
|
|
"inputTokens": 3000,
|
|
"cachedInputTokens": 2000,
|
|
"cacheWriteInputTokens": 100,
|
|
"outputTokens": 500,
|
|
"reasoningOutputTokens": 400
|
|
},
|
|
"modelContextWindow": 258400
|
|
}
|
|
}
|
|
}
|