mirror of
https://github.com/openai/codex.git
synced 2026-02-01 22:47:52 +00:00
Document turn context placeholders
This commit is contained in:
@@ -60,6 +60,10 @@ impl SessionState {
|
||||
self.history.record_items(items, policy);
|
||||
}
|
||||
|
||||
/// Keep `turn_context_history` aligned with user turns even when no TurnContextItem exists
|
||||
/// yet (e.g., legacy rollouts or model-sourced user messages). We push a `None` placeholder
|
||||
/// for each user message so later rollback/backtrack logic can safely index the latest
|
||||
/// user turn and optionally fill the slot with a TurnContextItem.
|
||||
pub(crate) fn record_user_turn_placeholders(&mut self, items: &[ResponseItem]) {
|
||||
for item in items {
|
||||
if matches!(item, ResponseItem::Message { role, .. } if role == "user") {
|
||||
|
||||
Reference in New Issue
Block a user