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-02 10:59:00 -07:00
2026-06-09 12:48:04 -07:00
2026-06-24 13:24:10 -07:00
2026-06-22 13:19:40 -07:00
2026-07-14 00:19:01 +00:00
2026-07-14 06:39:42 +00:00
2026-07-10 21:24:03 +00:00
2026-07-13 17:33:13 +00:00
2026-07-14 06:39:42 +00:00
2026-07-07 19:48:05 +00:00
2026-07-14 00:38:04 +00:00
2026-06-23 00:02:33 +00:00
2026-07-06 12:17:16 -07:00
2026-06-11 18:16:39 -07:00
2026-07-07 13:00:44 -07:00
2026-06-13 21:43:39 -07:00
2026-06-24 13:25:44 -07:00
2026-07-11 04:15:42 +00:00
2026-07-07 17:05:05 -07:00
2026-07-07 01:34:36 +00:00
2026-06-11 18:16:39 -07:00
2026-06-11 18:16:39 -07:00
2026-07-09 14:40:10 -07:00
2026-07-06 16:26:56 -07:00
2026-07-09 08:17:13 -07:00
2026-07-13 23:37:35 +00:00
2026-07-07 13:00:44 -07:00
2026-07-07 01:12:24 +00:00
2026-06-15 20:10:53 -07:00
2026-07-13 15:47:03 +00:00
2026-06-21 13:35:25 -07:00
2026-07-13 19:04:22 +00:00
2026-07-13 22:50:28 +00:00
2026-06-22 11:11:25 -07:00
2026-07-14 06:39:42 +00:00
2026-07-14 01:06:11 +00:00
2026-07-11 01:11:37 +00:00
2026-07-10 10:29:30 +00:00
2026-06-05 15:41:13 -07:00
2026-07-13 23:37:35 +00:00
2026-07-14 01:49:16 +00:00
2026-07-13 23:43:15 +00:00
2026-07-10 09:09:22 +00:00
2026-07-14 04:41:08 +00:00
2026-07-13 22:15:55 +00:00
2026-07-13 11:46:25 +00:00
2026-07-13 22:50:28 +00:00
2026-07-10 16:55:01 +00:00
2026-07-07 20:01:03 -04:00
2026-07-07 18:00:35 -07:00
2026-07-09 14:26:20 -07:00
2026-07-08 12:17:58 -04:00
2026-06-12 19:52:49 +00:00
2026-07-06 14:51:34 -07:00
2026-07-09 14:26:20 -07:00
2026-07-14 06:39:42 +00:00
2026-07-14 04:41:08 +00:00
2026-07-14 01:06:11 +00:00
2026-07-07 17:43:19 -07:00
2026-07-14 01:06:11 +00:00
2026-07-09 17:33:37 +01:00
2026-07-13 18:00:10 +00:00
2026-06-23 22:51:19 +01:00
2026-07-07 10:52:38 -07:00
2026-07-14 06:39:42 +00:00
2026-07-13 15:47:03 +00:00
2026-07-14 06:39:42 +00:00
2026-07-14 06:39:42 +00:00
2026-07-13 19:04:22 +00:00
2026-06-12 19:52:49 +00:00
2026-07-07 17:50:39 -04:00
2026-06-25 13:56:08 -07:00
2026-07-09 14:01:16 -07:00
2026-07-14 02:00:39 +00:00
2026-07-14 01:06:11 +00:00
2026-07-14 02:22:57 +00:00
2026-07-13 16:52:18 +00:00
2026-07-14 06:39:42 +00:00
2026-06-24 22:33:18 +00:00
2026-06-13 21:43:39 -07:00
2026-06-13 21:43:39 -07:00
2026-07-08 12:57:27 -07:00
2026-07-13 20:06:15 +00:00
2026-07-09 17:31:44 -07:00
2026-07-14 02:00:39 +00:00
2026-07-13 22:15:55 +00:00
2026-07-11 03:27:51 +00:00
2026-07-09 11:53:18 -07:00