Document rollback turn context helper

This commit is contained in:
Charles Cunningham
2026-02-02 22:29:40 -08:00
parent ec06fccbb7
commit a70e23ac5a
+6
View File
@@ -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<Option<TurnContextItem>>,