From a70e23ac5a326a713a4eda1b73f5aaf66eb5d099 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Sat, 31 Jan 2026 14:45:52 -0800 Subject: [PATCH] Document rollback turn context helper --- codex-rs/core/src/codex.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 2db2bec875..65c91fccd3 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -3194,6 +3194,12 @@ mod handlers { .await; } + /// Apply turn-context history updates after rollback. + /// + /// Truncates the stored history by the requested rollback depth, then pads to match the + /// surviving user-turn count. If the latest user turn has a stored collaboration mode, + /// update the session configuration; otherwise, force re-injection of collaboration + /// instructions on the next turn. fn apply_rollback_turn_context_history( state: &mut SessionState, existing_turn_context_history: Vec>,