Anton Panasenko
b75ec48a2c
Preserve active recovery turns when clients reconnect ( #61014 )
...
## Why
A recovery turn can occupy the core turn slot before `TurnStarted` is published and thread statuses reflect it. During this window, `thread/resume` with configuration overrides could treat an unsubscribed thread as idle and shut it down, interrupting recovery.
## What changed
Require the core turn slot to be empty before replacing a loaded thread during resume. Expose `CodexThread::has_active_turn()` and reuse it in the residency unload check.
## Testing
Add a regression test that blocks paginated history writes to hold a recovery turn before status publication, reconnects with a configuration override, and verifies that the client receives completion for the preserved recovery turn.
GitOrigin-RevId: f295038c8502a9b2849ddc08614db4a3cb5610cf
2026-11-12 04:17:58 +00:00
..
2026-11-12 04:17:58 +00:00
2026-10-17 04:02:21 +00:00
2026-11-11 23:49:59 +00:00
2026-11-08 01:13:32 +00:00
2026-11-11 18:56:47 +00:00
2026-11-03 02:37:20 +00:00
2026-10-30 18:20:57 +00:00
2026-11-11 23:49:59 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-09 20:24:40 +00:00
2026-08-31 22:38:23 +00:00
2026-11-07 02:46:41 +00:00
2026-11-12 00:27:01 +00:00
2026-11-09 22:20:07 +00:00
2026-11-11 10:10:37 +00:00
2026-11-11 10:10:37 +00:00
2026-11-11 23:49:59 +00:00
2026-11-03 23:49:01 +00:00
2026-11-10 21:26:11 +00:00
2026-11-06 01:50:20 +00:00
2026-11-04 16:34:49 +00:00
2026-11-04 16:34:49 +00:00
2026-11-04 16:34:49 +00:00
2026-10-26 21:15:23 +00:00
2026-10-26 21:15:23 +00:00
2026-11-04 19:58:24 +00:00
2026-11-04 19:58:24 +00:00
2026-11-06 22:27:23 +00:00
2026-11-06 22:27:23 +00:00
2026-11-04 19:58:24 +00:00
2026-09-24 22:54:29 +00:00
2026-11-12 02:43:37 +00:00
2026-10-28 21:34:25 +00:00
2026-10-28 21:34:25 +00:00
2026-10-29 19:29:05 +00:00
2026-11-10 01:30:43 +00:00
2026-11-03 15:02:57 +00:00
2026-11-12 04:17:58 +00:00
2026-11-10 03:21:26 +00:00
2026-11-04 13:03:01 +00:00
2026-09-09 18:40:53 +00:00
2026-11-04 00:19:12 +00:00
2026-11-06 06:07:46 +00:00
2026-11-06 04:33:14 +00:00
2026-11-04 00:19:12 +00:00
2026-11-04 00:19:12 +00:00
2026-11-04 00:19:12 +00:00
2026-11-06 04:33:14 +00:00
2026-10-10 17:30:25 +00:00
2026-10-29 11:15:52 +00:00
2026-10-05 16:10:27 +00:00
2026-11-10 00:07:10 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-05 22:49:46 +00:00
2026-11-04 09:51:28 +00:00
2026-11-03 02:37:20 +00:00
2026-11-03 02:37:20 +00:00
2026-11-04 04:02:00 +00:00
2026-11-06 07:43:44 +00:00
2026-10-05 23:52:06 +00:00
2026-10-08 13:45:19 +00:00
2026-11-03 11:14:59 +00:00
2026-10-14 19:47:50 +00:00
2026-11-07 03:06:33 +00:00
2026-11-07 02:46:41 +00:00
2026-11-10 21:26:11 +00:00
2026-09-18 23:07:36 +00:00
2026-09-18 23:07:36 +00:00
2026-10-07 03:07:51 +00:00
2026-10-01 15:57:03 +00:00
2026-11-05 20:55:46 +00:00
2026-11-03 02:37:20 +00:00
2026-10-19 11:40:15 +00:00
2026-11-03 21:24:16 +00:00
2026-10-27 22:59:22 +00:00
2026-10-27 22:59:22 +00:00
2026-11-11 10:10:37 +00:00
2026-11-05 03:49:13 +00:00
2026-11-11 23:36:19 +00:00
2026-08-29 06:05:28 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-11-11 23:36:19 +00:00
2026-09-16 15:17:41 +00:00
2026-10-28 11:48:00 +00:00
2026-11-07 07:45:36 +00:00
2026-11-03 02:08:56 +00:00
2026-10-28 05:46:04 +00:00
2026-11-03 15:02:57 +00:00
2026-11-10 11:17:06 +00:00
2026-11-06 22:27:23 +00:00
2026-11-09 20:24:40 +00:00
2026-11-06 07:43:44 +00:00
2026-08-31 22:38:23 +00:00
2026-10-27 12:17:14 +00:00
2026-11-11 09:58:13 +00:00
2026-09-29 02:05:56 +00:00
2026-11-11 18:58:21 +00:00
2026-10-26 18:31:49 +00:00
2026-11-07 10:41:36 +00:00
2026-11-07 10:41:36 +00:00
2026-09-24 16:36:57 +00:00
2026-09-24 16:36:57 +00:00
2026-08-31 23:29:20 +00:00
2026-09-17 18:20:28 +00:00
2026-09-29 16:53:11 +00:00
2026-10-17 04:02:21 +00:00
2026-10-16 17:31:47 +00:00
2026-10-16 17:31:47 +00:00
2026-10-07 17:59:22 +00:00
2026-11-10 21:26:11 +00:00
2026-11-03 02:37:20 +00:00
2026-10-08 13:45:19 +00:00
2026-09-30 03:22:55 +00:00
2026-09-30 03:22:55 +00:00
2026-11-04 01:15:38 +00:00
2026-11-07 02:01:23 +00:00
2026-11-07 02:01:23 +00:00
2026-11-06 07:43:44 +00:00
2026-11-07 21:31:08 +00:00
2026-11-03 22:29:33 +00:00
2026-10-30 18:34:10 +00:00
2026-11-11 23:36:19 +00:00
2026-11-10 19:13:55 +00:00
2026-10-10 01:25:00 +00:00
2026-10-06 10:39:16 +00:00
2026-11-11 10:10:37 +00:00
2026-10-02 16:55:41 +00:00
2026-11-03 14:15:56 +00:00
2026-10-01 03:31:48 +00:00
2026-10-28 11:48:00 +00:00
2026-10-14 18:01:54 +00:00
2026-11-06 07:43:44 +00:00
2026-11-03 23:49:01 +00:00
2026-10-17 04:02:21 +00:00
2026-09-18 00:25:37 +00:00
2026-09-19 01:21:32 +00:00
2026-10-08 06:31:56 +00:00
2026-09-09 19:31:12 +00:00
2026-09-23 18:40:12 +00:00