pakrym-oai
176af2b510
[codex] Reuse compacted history replacement for new context windows ( #29762 )
...
## Why
`start_new_context_window` independently replaced in-memory history and
persisted a compacted checkpoint instead of using the shared
compacted-history path. That bypassed the centralized missing-item-ID
assignment when `item_ids` is enabled, so fresh context messages could
enter the new context window and its persisted replacement history
without IDs.
This follows up on the token-budget compaction reset flow introduced in
[#29743 ](https://github.com/openai/codex/pull/29743 ).
## What changed
- Delegate new context-window installation to
`replace_compacted_history`.
- Reuse its ID assignment, in-memory replacement, world-state baseline,
checkpoint persistence, turn-context persistence, and session-start
bookkeeping.
- Add focused coverage that verifies generated IDs are present in live
history and preserved in the persisted replacement history.
## Testing
- `just test -p codex-core
start_new_context_window_assigns_and_persists_item_ids`
- `just test -p codex-core
new_context_tool_starts_new_window_before_follow_up`
2026-06-23 18:53:35 -07:00
..
2026-06-23 17:23:38 -07:00
2026-04-21 10:22:36 -07:00
2026-04-07 00:32:41 +00:00
2026-06-23 12:13:54 -07:00
2026-06-23 10:33:19 -07:00
2026-06-23 10:33:19 -07:00
2026-06-23 20:33:44 +00:00
2026-06-23 13:33:23 -07:00
2026-06-15 22:07:07 +00:00
2026-06-23 20:07:09 +01:00
2026-06-23 18:53:35 -07:00
2026-06-23 16:59:04 -07:00
2026-06-23 16:59:04 -07:00
2026-06-23 18:51:49 -07:00
2026-06-23 14:27:13 -07:00
2026-03-24 18:10:53 -07:00
2026-06-19 05:06:34 +00:00
2026-06-18 16:16:19 -07:00
2026-06-23 00:02:33 +00:00
2026-06-18 19:31:19 +00:00
2026-05-08 12:36:02 -07:00
2026-06-22 23:56:16 -07:00
2026-06-22 23:56:16 -07:00
2026-06-23 17:23:38 -07:00
2026-06-23 17:23:38 -07:00
2026-06-22 11:11:25 -07:00
2026-06-23 17:23:38 -07:00
2026-06-23 17:23:38 -07:00
2026-03-12 08:16:36 -07:00
2026-04-01 23:06:24 -07:00
2026-06-23 20:21:13 +00:00
2026-06-23 20:21:13 +00:00
2026-06-23 10:33:19 -07:00
2026-06-23 16:59:04 -07:00
2026-06-23 16:49:13 -07:00
2026-06-10 12:54:21 +02:00
2026-06-18 17:19:24 -04:00
2026-06-22 23:19:42 -07:00
2026-03-12 00:35:21 -07:00
2026-06-18 19:18:42 +00:00
2026-06-24 00:35:34 +00:00
2026-06-22 23:37:49 +00:00
2026-06-22 23:37:49 +00:00
2026-04-26 15:10:53 -07:00
2026-04-26 15:10:53 -07:00
2026-06-05 11:20:52 -07:00
2026-06-05 11:20:52 -07:00
2026-06-23 12:13:54 -07:00
2026-06-18 14:09:38 +02:00
2026-06-23 20:07:09 +01:00
2026-05-13 11:31:27 +02:00
2026-06-08 21:32:46 -07:00
2026-06-23 17:23:38 -07:00
2026-06-22 16:41:00 -07:00
2026-06-22 23:56:16 -07:00
2026-04-28 13:03:28 +02:00
2026-04-28 19:43:44 -07:00
2026-06-23 16:59:04 -07:00
2026-06-23 00:00:25 -07:00
2026-06-12 22:03:51 +00:00
2026-05-26 20:59:47 -07:00
2026-06-23 20:33:44 +00:00
2026-06-23 17:23:38 -07:00
2026-06-22 16:45:23 -07:00
2026-06-22 16:45:23 -07:00
2026-06-15 11:10:51 +02:00
2026-06-15 08:28:02 -07:00
2026-03-25 11:05:35 -07:00
2026-04-02 23:00:02 -07:00
2026-04-09 10:53:06 -07:00
2026-05-20 17:10:37 -07:00
2026-06-11 18:16:39 -07:00
2026-04-24 17:49:29 -07:00
2026-05-11 11:32:40 -07:00
2026-06-23 21:50:50 +00:00
2026-06-14 00:14:26 -07:00
2026-06-23 20:21:13 +00:00
2026-06-22 11:11:25 -07:00
2026-06-16 11:46:59 +02:00
2026-06-23 17:23:38 -07:00
2026-06-23 17:23:38 -07:00
2026-06-01 18:45:07 +00:00
2026-06-22 09:05:27 -07:00
2026-05-26 11:01:18 +02:00
2026-04-01 23:06:24 -07:00
2026-06-22 13:25:48 -07:00
2026-06-01 23:33:42 +00:00
2026-06-18 19:31:19 +00:00
2026-06-23 12:13:54 -07:00
2026-05-15 10:58:50 -07:00
2026-05-15 10:58:50 -07:00
2026-06-16 14:34:54 +02:00
2026-06-16 14:34:54 +02:00
2026-04-03 00:33:34 -07:00
2026-06-23 20:21:13 +00:00
2026-06-15 20:10:53 -07:00
2026-06-16 21:42:28 +00:00
2026-06-15 08:18:13 -07:00
2026-06-15 08:18:13 -07:00
2026-06-23 17:23:38 -07:00
2026-06-03 10:41:41 -07:00
2026-05-04 11:46:03 -07:00
2026-06-23 20:21:13 +00:00
2026-06-23 18:51:49 -07:00
2026-06-18 11:54:49 -07:00
2026-06-23 17:23:38 -07:00
2026-06-23 17:23:38 -07:00
2026-06-23 10:33:19 -07:00
2026-06-12 13:50:04 -07:00
2026-06-23 00:02:33 +00:00
2026-06-10 17:17:44 -07:00
2026-06-22 09:05:27 -07:00
2026-06-22 09:05:27 -07:00
2026-06-22 11:11:25 -07:00
2026-06-22 23:56:16 -07:00
2026-04-20 22:39:17 -07:00
2026-06-16 22:17:24 -07:00
2026-05-14 16:54:59 -07:00
2026-05-14 16:54:59 -07:00
2026-01-30 16:37:56 -08:00
2026-05-28 15:26:55 -07:00
2026-05-28 15:26:55 -07:00
2026-05-22 12:13:52 +02:00
2026-05-29 11:01:44 -07:00