pakrym-oai
f92655d07f
Preempt model responses when new user input arrives ( #48141 )
...
## Why
With `instant_interrupt` enabled, new user input should reach the model without waiting for an unfinished response or stream retry backoff.
## What changed
- Interrupt request setup, response streaming, and retry backoff when user input arrives, then continue the turn with the queued input.
- Reset the WebSocket connection and continuation state after preemption so the next request sends full history.
- Drain pending input after a preempted step even when compaction leaves the estimated context above the token limit.
## Testing
Add regression coverage for WebSocket reconnection with full history, interrupted retry backoff, input queued during compaction, and yielding running code-mode calls. Add a streaming scenario that preserves completed commentary while excluding unfinished assistant text from the replacement request.
GitOrigin-RevId: b7e42b6afffbf87da15af05e0850af8579d1353f
2026-09-25 17:05:53 +00:00
..
2026-09-22 19:58:52 +00:00
2026-09-25 17:05:53 +00:00
2026-09-25 00:07:35 +00:00
2026-09-02 22:45:19 +00:00
2026-09-11 22:55:38 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 20:59:51 +00:00
2026-09-24 18:07:37 +00:00
2026-09-23 19:16:20 +00:00
2026-09-23 05:22:16 +00:00
2026-09-24 18:07:37 +00:00
2026-09-16 21:50:07 +00:00
2026-09-24 20:28:31 +00:00
2026-08-20 17:46:05 +00:00
2026-09-24 16:36:57 +00:00
2026-09-24 20:28:31 +00:00
2026-08-13 00:00:16 +00:00
2026-09-23 00:47:07 +00:00
2026-09-19 00:18:56 +00:00
2026-09-15 18:23:08 +00:00
2026-08-29 03:44:01 +00:00
2026-08-25 21:34:05 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 20:28:31 +00:00
2026-09-03 16:21:10 +00:00
2026-08-13 00:00:16 +00:00
2026-09-21 22:49:17 +00:00
2026-09-24 22:54:29 +00:00
2026-09-14 15:06:28 +00:00
2026-08-25 23:42:50 +00:00
2026-09-14 21:33:45 +00:00
2026-09-19 00:46:06 +00:00
2026-09-12 18:41:47 +00:00
2026-09-23 15:15:24 +00:00
2026-09-24 18:07:37 +00:00
2026-09-25 15:03:02 +00:00
2026-09-15 21:19:08 +00:00
2026-09-16 18:54:45 +00:00
2026-09-09 18:40:53 +00:00
2026-08-20 18:29:35 +00:00
2026-08-27 00:02:26 +00:00
2026-08-20 18:29:35 +00:00
2026-09-24 22:54:29 +00:00
2026-09-19 01:21:32 +00:00
2026-09-19 01:21:32 +00:00
2026-09-24 04:16:35 +00:00
2026-09-09 03:17:48 +00:00
2026-09-24 18:07:37 +00:00
2026-09-18 22:42:46 +00:00
2026-09-05 01:04:12 +00:00
2026-09-24 11:19:16 +00:00
2026-09-24 11:19:16 +00:00
2026-09-17 16:06:11 +00:00
2026-09-23 22:50:48 +00:00
2026-09-23 22:50:48 +00:00
2026-09-25 14:54:51 +00:00
2026-09-24 14:48:41 +00:00
2026-09-23 22:50:48 +00:00
2026-09-23 20:05:09 +00:00
2026-09-24 18:07:37 +00:00
2026-09-25 10:49:50 +00:00
2026-09-10 09:50:59 +00:00
2026-09-16 22:25:29 +00:00
2026-09-25 14:54:51 +00:00
2026-09-23 22:50:48 +00:00
2026-09-25 15:26:34 +00:00
2026-09-19 01:21:32 +00:00
2026-09-24 20:39:37 +00:00
2026-09-25 03:12:10 +00:00
2026-09-21 22:58:49 +00:00
2026-09-08 20:37:30 +00:00
2026-08-25 01:27:18 +00:00
2026-09-15 21:19:08 +00:00
2026-09-01 15:04:11 +00:00
2026-06-15 21:53:47 -07:00
2026-09-24 18:07:37 +00:00
2026-09-21 20:34:46 +00:00
2026-09-20 19:42:18 +00:00
2026-09-14 16:30:00 +00:00
2026-09-21 07:01:52 +00:00
2026-09-03 15:12:02 +00:00
2026-09-25 03:12:10 +00:00
2026-09-24 20:39:37 +00:00
2026-09-24 20:39:37 +00:00
2026-09-20 19:42:18 +00:00
2026-09-16 20:32:52 +00:00
2026-09-25 02:54:07 +00:00
2026-09-24 20:28:31 +00:00
2026-09-07 17:26:10 +00:00
2026-09-24 16:36:57 +00:00
2026-05-18 21:03:51 -07:00
2026-09-17 19:12:42 +00:00
2026-09-23 22:10:04 +00:00
2026-08-13 00:00:16 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 20:28:31 +00:00
2026-09-19 01:36:53 +00:00
2026-09-24 20:28:31 +00:00
2026-08-20 17:46:05 +00:00
2026-08-29 03:28:19 +00:00
2026-09-22 21:42:11 +00:00
2026-09-24 12:15:57 +00:00
2026-09-23 21:34:11 +00:00
2026-08-27 00:02:26 +00:00
2026-09-22 21:57:52 +00:00
2026-09-25 11:30:57 +00:00
2026-09-22 23:56:23 +00:00
2026-09-24 20:28:31 +00:00
2026-06-08 13:55:15 -07:00
2026-09-23 22:52:55 +00:00
2026-09-25 17:05:53 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 20:28:31 +00:00
2026-09-25 11:43:35 +00:00
2026-09-24 18:07:37 +00:00
2026-09-16 21:01:13 +00:00
2026-07-22 20:23:35 +00:00
2026-09-15 04:20:38 +00:00
2026-09-23 17:34:58 +00:00
2026-09-22 22:20:00 +00:00
2026-09-22 22:20:00 +00:00
2026-09-23 00:47:07 +00:00
2026-09-22 22:20:00 +00:00
2026-09-24 18:07:37 +00:00
2026-09-09 18:50:32 +00:00
2026-09-24 20:59:51 +00:00
2026-09-19 01:36:53 +00:00
2026-08-13 00:00:16 +00:00
2026-08-31 20:50:44 +00:00
2026-08-31 20:50:44 +00:00
2026-09-22 19:51:33 +00:00
2026-09-24 07:21:20 +00:00
2026-08-13 00:00:16 +00:00
2026-08-13 00:00:16 +00:00
2026-09-15 21:19:08 +00:00
2026-09-10 03:18:28 +00:00
2026-09-10 18:24:13 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 23:33:38 +00:00
2026-09-17 14:47:42 +00:00
2026-09-24 20:39:37 +00:00
2026-09-11 21:32:04 +00:00
2026-09-09 04:07:40 +00:00
2026-07-23 19:19:35 +00:00
2026-08-13 00:00:16 +00:00
2026-09-22 20:07:50 +00:00
2026-09-25 11:42:44 +00:00
2026-09-24 12:34:04 +00:00
2026-09-24 16:07:15 +00:00
2026-09-24 20:59:51 +00:00
2026-09-24 18:38:58 +00:00
2026-09-23 22:09:18 +00:00
2026-09-22 21:57:52 +00:00
2026-09-22 05:53:29 +00:00
2026-09-16 22:25:54 +00:00
2026-09-24 18:07:37 +00:00
2026-09-25 17:05:53 +00:00
2026-09-24 20:39:37 +00:00
2026-09-24 20:59:51 +00:00
2026-09-24 20:59:51 +00:00
2026-09-25 14:15:05 +00:00
2026-08-20 17:46:05 +00:00
2026-09-24 18:07:37 +00:00
2026-09-21 17:28:14 +00:00
2026-09-19 00:18:56 +00:00
2026-09-22 11:10:29 +00:00
2026-09-24 20:39:37 +00:00
2026-09-09 15:54:07 +00:00
2026-09-09 18:04:04 +00:00
2026-09-09 17:56:33 +00:00
2026-09-24 20:59:51 +00:00
2026-09-19 01:36:53 +00:00
2026-09-19 01:36:53 +00:00
2026-09-22 19:39:18 +00:00
2026-08-28 09:48:13 +00:00
2026-09-24 20:39:37 +00:00
2026-09-02 22:45:19 +00:00
2026-08-30 07:40:36 +00:00
2026-09-23 20:49:48 +00:00
2026-09-23 20:49:48 +00:00
2026-08-20 17:46:05 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 20:39:37 +00:00
2026-09-22 22:20:00 +00:00
2026-09-04 20:38:08 +00:00
2026-09-23 11:42:45 +00:00
2026-09-24 15:57:42 +00:00
2026-09-24 09:52:46 +00:00
2026-08-28 15:44:48 +00:00
2026-09-19 01:27:26 +00:00
2026-09-24 20:28:31 +00:00
2026-08-10 19:26:52 +00:00
2026-08-13 00:00:16 +00:00
2026-08-28 18:07:40 +00:00
2026-09-24 20:28:31 +00:00
2026-09-22 06:24:49 +00:00
2026-09-24 20:28:31 +00:00
2026-08-13 00:00:16 +00:00
2026-09-24 18:07:37 +00:00
2026-09-24 19:15:17 +00:00
2026-09-19 01:21:32 +00:00
2026-08-20 06:29:32 +00:00