mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
## Why Clients that account for individual upstream Responses API calls need the exact usage for each completion rather than accumulated or estimated thread usage. ## What changed - Add the opt-in `rawResponse/completed` app-server notification with the `threadId`, `turnId`, `responseId`, and upstream `usage` payload. - Emit the transient event for normal turns and compaction requests when `experimentalRawEvents` is enabled. The event is not persisted or replayed, and `usage` is `null` when the upstream response omits it. - Export the notification in the app-server schemas and document its behavior. ## Testing - Cover exact token breakdowns for turn and compaction completions. GitOrigin-RevId: 49040a060bf1784c1ff1dd62112efb4a778428c4