Dylan Hurd
1c9f890c05
Expose exact per-response usage in raw app-server events ( #32985 )
...
## 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
2026-07-14 06:39:42 +00:00
..
2026-07-08 14:13:59 -07:00
2026-06-25 18:15:48 -07:00
2026-07-08 17:50:18 +00:00
2026-07-08 14:13:59 -07:00
2026-07-09 00:17:38 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-14 06:39:42 +00:00
2026-07-08 00:15:49 +00:00
2026-05-28 14:54:39 -07:00
2026-07-06 10:17:15 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-14 01:49:16 +00:00
2026-06-27 19:34:10 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-13 22:15:55 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-09 12:25:19 +09:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-14 04:41:08 +00:00
2026-07-08 00:15:49 +00:00
2026-07-14 01:49:16 +00:00
2026-07-10 16:11:58 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-09 12:16:15 -04:00
2026-07-11 01:11:37 +00:00
2026-07-10 21:13:38 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-08 00:15:49 +00:00
2026-06-26 09:12:42 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 09:59:50 -07:00
2026-07-08 00:15:49 +00:00
2026-07-14 04:41:08 +00:00
2026-07-14 04:41:08 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 00:15:49 +00:00
2026-05-12 18:40:53 -07:00
2026-07-08 00:15:49 +00:00
2026-07-13 09:40:51 +00:00
2026-07-08 00:15:49 +00:00
2026-07-14 04:41:08 +00:00
2026-07-08 14:13:59 -07:00
2026-07-14 04:41:08 +00:00
2026-07-14 00:38:04 +00:00
2026-07-08 00:15:49 +00:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-08 14:13:59 -07:00
2026-07-14 06:39:42 +00:00
2026-07-08 14:13:59 -07:00
2026-07-13 23:37:35 +00:00
2026-07-08 00:15:49 +00:00