mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Preserve paginated history for spawned subagents (#33432)
## What changed - Inherit paginated history mode when spawning or forking a subagent from a paginated parent. - Load the parent's model context when forking and persist it as an inherited rollout prefix, while excluding that prefix from the child's projected turns, items, and metadata. - Record the boundary between inherited context and child history, and reject partially initialized paginated subagent rollouts on resume. - Resume paginated subagents from their stored model context instead of legacy rollout history. ## Testing Added coverage for fresh and forked paginated subagents, compacted-history forks, model-context resume, inherited-prefix projection, metadata isolation, and incomplete-prefix detection. GitOrigin-RevId: e57dc37c29aa4aaaf57b052b991be591d730e5ba
This commit is contained in:
@@ -3088,6 +3088,12 @@ pub struct SessionMeta {
|
||||
pub memory_mode: Option<String>,
|
||||
#[serde(default)]
|
||||
pub history_mode: ThreadHistoryMode,
|
||||
/// First rollout ordinal that belongs to this subagent's own projected history.
|
||||
///
|
||||
/// Earlier rollout records are inherited model context and stay out of child
|
||||
/// turn/item projection.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub subagent_history_start_ordinal: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub multi_agent_version: Option<MultiAgentVersion>,
|
||||
/// Initial context-window identity for consumers that tail rollout JSONL before compaction.
|
||||
@@ -3118,6 +3124,7 @@ impl Default for SessionMeta {
|
||||
selected_capability_roots: Vec::new(),
|
||||
memory_mode: None,
|
||||
history_mode: ThreadHistoryMode::default(),
|
||||
subagent_history_start_ordinal: None,
|
||||
multi_agent_version: None,
|
||||
context_window: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user