Eric Traut
214b9007dd
Restore token usage after compaction on paginated thread resume ( #65035 )
...
## Why
A compaction checkpoint can leave the turn's `TurnStarted` event outside
the replay window. When `thread/resume` excludes turns, the app server
can then miss the turn ID and omit the saved token usage update.
## What changed
Fall back to the latest saved `TurnContext` in the active turn when
that turn starts at a compaction checkpoint. Use its turn ID to replay
the saved `thread/tokenUsage/updated` notification.
## Testing
Extend cold resume tests to check the turn ID, total and last token
counts, and context window after compaction. Cover a rollback that
leaves the usage owner unknown and verify that replay is skipped.
GitOrigin-RevId: 4ea4f5e7a561fbba00fbe6b063f632a23193bc5a
2026-12-01 16:53:34 +00:00
..
2026-09-26 23:17:41 +00:00
2026-11-24 16:14:00 +00:00
2026-12-01 16:53:34 +00:00
2026-11-25 00:44:23 +00:00
2026-11-18 00:46:17 +00:00
2026-11-05 05:09:32 +00:00
2026-09-23 00:49:19 +00:00
2026-10-26 18:05:05 +00:00
2026-11-27 16:25:10 +00:00
2026-11-18 06:22:36 +00:00
2026-11-04 22:20:18 +00:00
2026-11-25 16:09:51 +00:00
2026-11-24 00:14:14 +00:00
2026-10-27 08:06:10 +00:00
2026-11-24 00:14:14 +00:00
2026-11-22 01:25:05 +00:00
2026-11-22 01:25:05 +00:00
2026-11-25 00:44:23 +00:00
2026-09-16 00:54:58 +00:00
2026-11-24 23:38:37 +00:00
2026-11-10 02:45:30 +00:00
2026-10-09 23:16:46 +00:00
2026-11-25 22:41:36 +00:00
2026-11-26 20:37:00 +00:00
2026-11-10 01:28:45 +00:00
2026-10-26 18:20:30 +00:00
2026-11-19 05:12:34 +00:00
2026-11-25 22:46:26 +00:00
2026-10-22 19:36:47 +00:00
2026-11-25 22:46:26 +00:00
2026-09-24 17:04:50 +00:00
2026-11-17 23:46:48 +00:00
2026-11-14 01:54:53 +00:00
2026-10-06 19:51:15 +00:00
2026-11-23 01:06:41 +00:00
2026-11-10 01:28:45 +00:00
2026-10-29 11:23:51 +00:00
2026-11-05 05:09:32 +00:00
2026-11-06 22:27:47 +00:00
2026-11-30 23:34:32 +00:00
2026-11-13 23:04:26 +00:00
2026-11-03 15:02:57 +00:00
2026-09-21 01:19:40 +00:00
2026-10-06 01:46:33 +00:00
2026-11-17 23:46:48 +00:00
2026-11-17 21:10:09 +00:00
2026-10-28 06:22:58 +00:00
2026-11-24 23:38:37 +00:00
2026-10-07 23:19:26 +00:00
2026-11-14 01:54:53 +00:00
2026-11-25 22:40:22 +00:00
2026-10-23 18:39:28 +00:00
2026-11-25 00:44:23 +00:00
2026-10-26 17:56:43 +00:00
2026-10-22 19:36:47 +00:00
2026-10-20 03:09:44 +00:00
2026-11-19 21:44:38 +00:00
2026-11-27 16:25:10 +00:00
2026-10-28 16:55:57 +00:00
2026-11-17 23:46:48 +00:00
2026-11-17 23:46:48 +00:00
2026-11-19 15:45:17 +00:00
2026-11-19 15:45:17 +00:00
2026-11-20 17:59:03 +00:00
2026-11-05 05:09:32 +00:00
2026-11-05 05:09:32 +00:00
2026-11-05 05:09:32 +00:00
2026-11-13 04:51:06 +00:00
2026-11-12 00:44:27 +00:00
2026-11-13 04:51:06 +00:00
2026-11-19 22:15:23 +00:00
2026-10-07 19:28:14 +00:00
2026-10-07 19:28:14 +00:00
2026-11-12 00:44:27 +00:00
2026-11-12 00:44:27 +00:00
2026-11-12 00:44:27 +00:00
2026-11-12 00:44:27 +00:00