From 28cd3e25014cef77ef42a624dbb90ade3e897560 Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Tue, 6 Oct 2026 20:07:17 +0000 Subject: [PATCH] Remove obsolete fields from persisted turn context (#51492) ## What changed Remove `workspace_roots`, `current_date`, `timezone`, `network`, `personality`, and `multi_agent_mode` from `TurnContextItem` and stop recording them in rollouts. Update the precomputed protocol schema accordingly. Make `summary` optional when reading turn context and write `"none"` as a compatibility placeholder for older readers, rather than persisting the active reasoning-summary setting. ## Testing Update protocol tests to cover omitted `summary` fields and compatibility-placeholder serialization. Extend compaction tests to verify that model requests retain the updated reasoning-summary setting after compaction while the rollout checkpoint records the placeholder. GitOrigin-RevId: d49eabaa1b340be1d79f7f09115281a307ea8a64 --- .../app-server-exports-stable.json.zst | Bin 158108 -> 158034 bytes .../request_processors/feedback_processor.rs | 8 +- .../persisted_resume_settings_tests.rs | 8 +- .../core/src/context_manager/history_tests.rs | 8 +- codex-rs/core/src/session/mod.rs | 1 - .../session/rollout_reconstruction_tests.rs | 64 ++------------- .../core/src/session/step_activation_tests.rs | 27 ------ codex-rs/core/src/session/step_context.rs | 1 - codex-rs/core/src/session/tests.rs | 8 +- codex-rs/core/src/session/turn_context.rs | 77 +----------------- codex-rs/core/tests/suite/remote_env.rs | 11 +-- codex-rs/core/tests/suite/resume_warning.rs | 14 ++-- codex-rs/core/tests/suite/review.rs | 1 - .../tests/suite/step_settings_compaction.rs | 10 ++- codex-rs/protocol/src/protocol.rs | 61 +++----------- codex-rs/rollout/src/recorder_tests.rs | 8 +- codex-rs/state/src/extract.rs | 32 +------- codex-rs/thread-store/src/local/mod.rs | 8 +- .../src/local/model_context_tests.rs | 8 +- .../src/local/rollout_migration_tests.rs | 8 +- 20 files changed, 46 insertions(+), 317 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst index 0f06557f59aa0e064b2b570c5a9ea7f5b274fdd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F* zkYLxo-wT%rL4GU`7!$oC1o6MSo14G_w%}Zjq(NPM_25H5yDMKkwVaSde?(Vgl%;Kh zB%)!x0u{zT5}0`odslJUWJ>~=wcR{v9%e;Pq03mKI&K|8E#aXmyQc**+;HtYt>e~T z!z^C9h)}N(rqZ77fo`o8s$%FWLc*b_)s@62m55uA_vGO4d^jGQzVMHl>wMz7DKp{vEhriPdvSJEm5~O%xe@Ime6oK$@wh9ng z29=s_;7fjSPsX`12O@H#+1?#9PfBFMhk#zQ>ftyCQZ=s(Zj2hv5l*+azJ@4jA8i}K zc%?W5=uW7)0NTBZI+HSrv>uQTl*?Nl^fc`swPX7t2REtmrg=qZ8crQd`+uyD)J|@7 zq}zh-(-T-mGp$yQ0`?wcxUu7W-qBbs}-4mgm z+@_n)CqmcqCp`%0dl~F&xNqb_9bS=*R6?heZT7y??&X05qOd{m-|Hy*KoYTpe3MO00srv!QSLvo0nDkfb)= z=Nm0-_Co5Ze;zuaxuJ-c#NPr61PaP?f^4$mevdL`s7#4<250B{t!G&%nI9LYt25ot zFPQ^*)~(QEcAl1R5>Pnwn~}vOyS*uxNdovv?doFo&49XpTi@$qbf#8a9AaO4Dga8t znGb610)HMpRamOWLz`}|9=qeqQ8m73ZM*Diy16%^f6#+VX{UF0H<z~Bd-(~9yL#C<)LSZFQ)v9Cl_FA_9 diff --git a/codex-rs/app-server/src/request_processors/feedback_processor.rs b/codex-rs/app-server/src/request_processors/feedback_processor.rs index a5192d03ea..2558c004cb 100644 --- a/codex-rs/app-server/src/request_processors/feedback_processor.rs +++ b/codex-rs/app-server/src/request_processors/feedback_processor.rs @@ -763,26 +763,20 @@ mod tests { disabled_plugin_ids: None, cwd: AbsolutePathBuf::from_absolute_path(tempdir.path()) .expect("absolute feedback rollout directory"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: codex_protocol::protocol::AskForApproval::Never, approvals_reviewer: None, sandbox_policy: codex_protocol::protocol::SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: (*model).to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: effort.clone(), - summary: ReasoningSummary::Auto, + summary: Some(ReasoningSummary::Auto), }), } })); diff --git a/codex-rs/app-server/src/request_processors/persisted_resume_settings_tests.rs b/codex-rs/app-server/src/request_processors/persisted_resume_settings_tests.rs index d6ce293b53..4531226b58 100644 --- a/codex-rs/app-server/src/request_processors/persisted_resume_settings_tests.rs +++ b/codex-rs/app-server/src/request_processors/persisted_resume_settings_tests.rs @@ -67,26 +67,20 @@ fn turn_context_item( root_turn_id: None, disabled_plugin_ids: None, cwd: cwd(), - workspace_roots: Some(vec![cwd()]), - current_date: None, - timezone: None, approval_policy, approvals_reviewer, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: Some(PermissionProfile::read_only()), active_permission_profile, - network: None, file_system_sandbox_policy: None, model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }) } diff --git a/codex-rs/core/src/context_manager/history_tests.rs b/codex-rs/core/src/context_manager/history_tests.rs index 9e2696e7a0..c5551b6320 100644 --- a/codex-rs/core/src/context_manager/history_tests.rs +++ b/codex-rs/core/src/context_manager/history_tests.rs @@ -714,26 +714,20 @@ fn reference_context_item() -> TurnContextItem { .join("reference-cwd"), ) .expect("absolute reference cwd"), - workspace_roots: None, - current_date: Some("2026-03-23".to_string()), - timezone: Some("America/Los_Angeles".to_string()), approval_policy: AskForApproval::OnRequest, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "gpt-test".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(false), cyber_access_program: None, effort: None, - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), } } diff --git a/codex-rs/core/src/session/mod.rs b/codex-rs/core/src/session/mod.rs index 960958b290..1c17e53ec8 100644 --- a/codex-rs/core/src/session/mod.rs +++ b/codex-rs/core/src/session/mod.rs @@ -155,7 +155,6 @@ use codex_protocol::protocol::ThreadSettingsSnapshot; use codex_protocol::protocol::ThreadSource; use codex_protocol::protocol::TurnAbortReason; use codex_protocol::protocol::TurnContextItem; -use codex_protocol::protocol::TurnContextNetworkItem; use codex_protocol::protocol::TurnEnvironmentRequest; use codex_protocol::protocol::TurnEnvironmentSelection; use codex_protocol::protocol::TurnStartedEvent; diff --git a/codex-rs/core/src/session/rollout_reconstruction_tests.rs b/codex-rs/core/src/session/rollout_reconstruction_tests.rs index 4cbf3518a2..879115d3d0 100644 --- a/codex-rs/core/src/session/rollout_reconstruction_tests.rs +++ b/codex-rs/core/src/session/rollout_reconstruction_tests.rs @@ -444,26 +444,20 @@ async fn record_initial_history_resumed_bare_turn_context_does_not_hydrate_previ disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let rollout_items = vec![RolloutItem::TurnContext(previous_context_item)]; @@ -496,26 +490,20 @@ async fn record_initial_history_resumed_hydrates_previous_turn_settings_from_lif disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: Some("comp-hash-a".to_string()), - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let turn_id = previous_context_item .turn_id @@ -2140,26 +2128,20 @@ async fn record_initial_history_resumed_turn_context_after_compaction_reestablis disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let previous_turn_id = previous_context_item .turn_id @@ -2244,26 +2226,20 @@ async fn record_initial_history_resumed_turn_context_after_compaction_reestablis disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), })) .expect("serialize expected reference context item") ); @@ -2280,26 +2256,20 @@ async fn record_initial_history_resumed_aborted_turn_without_id_clears_active_tu disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let previous_turn_id = previous_context_item .turn_id @@ -2429,26 +2399,20 @@ async fn record_initial_history_resumed_unmatched_abort_preserves_active_turn_fo disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: current_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let rollout_items = vec![ @@ -2570,26 +2534,20 @@ async fn record_initial_history_resumed_trailing_incomplete_turn_compaction_clea disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let previous_turn_id = previous_context_item .turn_id @@ -2761,26 +2719,20 @@ async fn record_initial_history_resumed_replaced_incomplete_compacted_turn_clear disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let previous_turn_id = previous_context_item .turn_id diff --git a/codex-rs/core/src/session/step_activation_tests.rs b/codex-rs/core/src/session/step_activation_tests.rs index edf95cc3af..f57dec6232 100644 --- a/codex-rs/core/src/session/step_activation_tests.rs +++ b/codex-rs/core/src/session/step_activation_tests.rs @@ -668,33 +668,6 @@ async fn submitted_sparse_updates_preserve_captured_steps_and_ordering() { ] ); assert!(Arc::ptr_eq(&before.turn, &after.turn)); - assert_eq!( - turn.to_turn_context_item().summary, - ReasoningSummary::Concise - ); - // Even after the live update, an already-captured request retains its own - // summary setting in the durable context. - for step in [&before, &during, &after] { - session - .record_context_updates_and_set_reference_context_item(step) - .await - .expect("record captured settings"); - assert_eq!( - session.reference_context_item().await.unwrap().summary, - step.settings.reasoning_summary, - ); - let world_state = Arc::new( - session - .build_world_state_for_step(step, /*new_window*/ true) - .await - .unwrap(), - ); - session.start_new_context_window(step, world_state).await; - assert_eq!( - session.reference_context_item().await.unwrap().summary, - step.settings.reasoning_summary, - ); - } assert_eq!(after.settings.model_info.as_ref(), &expected_destination); let initial_budget = turn .config diff --git a/codex-rs/core/src/session/step_context.rs b/codex-rs/core/src/session/step_context.rs index 3f4e064650..a426437014 100644 --- a/codex-rs/core/src/session/step_context.rs +++ b/codex-rs/core/src/session/step_context.rs @@ -76,7 +76,6 @@ impl StepContext { pub(crate) fn to_turn_context_item(&self) -> TurnContextItem { let mut item = self.turn.to_turn_context_item(); item.realtime_active = Some(self.realtime.active); - item.summary = self.settings.reasoning_summary; item } diff --git a/codex-rs/core/src/session/tests.rs b/codex-rs/core/src/session/tests.rs index 24e78e645e..e5a7bda4ee 100644 --- a/codex-rs/core/src/session/tests.rs +++ b/codex-rs/core/src/session/tests.rs @@ -4326,26 +4326,20 @@ async fn record_initial_history_forked_hydrates_previous_turn_settings() { disabled_plugin_ids: None, #[allow(deprecated)] cwd: turn_context.cwd.clone(), - workspace_roots: None, - current_date: turn_context.current_date.clone(), - timezone: turn_context.timezone.clone(), approval_policy: turn_context.approval_policy(), approvals_reviewer: None, sandbox_policy: turn_context.sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: turn_context.personality(), collaboration_mode: Some(turn_context.collaboration_mode()), multi_agent_version: None, - multi_agent_mode: None, realtime_active: Some(turn_context.realtime_active), cyber_access_program: None, effort: turn_context.reasoning_effort().cloned(), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }; let turn_id = previous_context_item .turn_id diff --git a/codex-rs/core/src/session/turn_context.rs b/codex-rs/core/src/session/turn_context.rs index 9a57d40291..f74f5558ca 100644 --- a/codex-rs/core/src/session/turn_context.rs +++ b/codex-rs/core/src/session/turn_context.rs @@ -737,29 +737,6 @@ impl TurnContext { ) } - /// Combines the selected environment's workspace roots with its permission profile roots. - pub(crate) fn effective_workspace_roots(&self) -> Vec { - let Some(environment) = self.initial_environments.primary() else { - return self.config.effective_workspace_roots(); - }; - - let mut workspace_roots = environment.workspace_roots().to_vec(); - for root in environment - .config() - .permission_profile - .profile_workspace_roots() - { - let root = root.as_uri(); - if !workspace_roots - .iter() - .any(|existing| existing.to_string() == root.to_string()) - { - workspace_roots.push(root.clone()); - } - } - workspace_roots - } - /// Legacy: returns the frozen initial-turn reasoning effort, including the initial model default. /// Step-scoped consumers should use their captured `StepContext::settings`. pub(crate) fn effective_reasoning_effort(&self) -> Option { @@ -913,31 +890,6 @@ impl TurnContext { } pub(crate) fn to_turn_context_item(&self) -> TurnContextItem { - // The legacy rollout field still stores host-native paths. Keep its - // runtime-root filtering and omit it for unrepresentable profile roots; - // the authoritative permission profile retains its concrete entries. - let profile_roots = self.initial_environments.primary().map_or_else( - || self.config.permissions.profile_workspace_roots(), - |environment| { - environment - .config() - .permission_profile - .profile_workspace_roots() - }, - ); - let workspace_roots = if profile_roots - .iter() - .all(|root| root.as_uri().to_abs_path().is_ok()) - { - let roots = self - .effective_workspace_roots() - .iter() - .filter_map(|root| root.to_abs_path().ok()) - .collect::>(); - (!roots.is_empty()).then_some(roots) - } else { - None - }; #[allow(deprecated)] let cwd = self.cwd.clone(); TurnContextItem { @@ -945,9 +897,6 @@ impl TurnContext { root_turn_id: self.turn_metadata_state.root_turn_id(), disabled_plugin_ids: Some(self.disabled_plugin_ids.clone()), cwd, - workspace_roots, - current_date: self.current_date.clone(), - timezone: self.timezone.clone(), approval_policy: self.approval_policy(), approvals_reviewer: Some(self.config.approvals_reviewer), sandbox_policy: self.sandbox_policy(), @@ -956,41 +905,17 @@ impl TurnContext { || self.config.permissions.active_permission_profile(), TurnEnvironment::active_permission_profile, ), - network: self.turn_context_network_item(), file_system_sandbox_policy: self.non_legacy_file_system_sandbox_policy(), model: self.model_info().slug.clone(), comp_hash: self.model_info().comp_hash.clone(), - personality: self.personality(), collaboration_mode: Some(self.collaboration_mode()), multi_agent_version: Some(self.multi_agent_version), - multi_agent_mode: None, realtime_active: Some(self.realtime_active), cyber_access_program: self.cyber_access_program, effort: self.reasoning_effort().cloned(), - summary: self.reasoning_summary(), + summary: Some(ReasoningSummaryConfig::None), } } - - fn turn_context_network_item(&self) -> Option { - let network = self - .config - .config_layer_stack - .requirements() - .network - .as_ref()?; - Some(TurnContextNetworkItem { - allowed_domains: network - .domains - .as_ref() - .and_then(codex_config::NetworkDomainPermissionsToml::allowed_domains) - .unwrap_or_default(), - denied_domains: network - .domains - .as_ref() - .and_then(codex_config::NetworkDomainPermissionsToml::denied_domains) - .unwrap_or_default(), - }) - } } /// Grants and their review requirement share a lock so readers cannot see a new grant before diff --git a/codex-rs/core/tests/suite/remote_env.rs b/codex-rs/core/tests/suite/remote_env.rs index d80e5f4fb4..3e63e099e9 100644 --- a/codex-rs/core/tests/suite/remote_env.rs +++ b/codex-rs/core/tests/suite/remote_env.rs @@ -701,12 +701,6 @@ async fn environment_permissions_follow_configuration_ownership() -> Result<()> _ => None, }) .context("owner turn context")?; - assert!( - turn_context - .workspace_roots - .as_ref() - .is_some_and(|roots| roots.contains(&owner_profile_workspace_root)) - ); assert_eq!( ( turn_context.permission_profile, @@ -807,14 +801,13 @@ async fn executor_profile_roots_survive_settings_restore_and_turn_recording() -> _ => None, }) .context("recorded turn context")?; - // The rollout retains compiled permissions, not the unprojectable root list. + // The rollout retains compiled permissions. assert_eq!( ( context.permission_profile, context.active_permission_profile, - context.workspace_roots ), - (Some(expected_profile), Some(active_profile), None) + (Some(expected_profile), Some(active_profile)) ); Ok(()) } diff --git a/codex-rs/core/tests/suite/resume_warning.rs b/codex-rs/core/tests/suite/resume_warning.rs index 599f307c07..0d4866d9b7 100644 --- a/codex-rs/core/tests/suite/resume_warning.rs +++ b/codex-rs/core/tests/suite/resume_warning.rs @@ -33,28 +33,24 @@ fn resume_history( root_turn_id: None, disabled_plugin_ids: None, cwd: config.cwd.clone(), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: config.permissions.approval_policy.value(), approvals_reviewer: None, sandbox_policy: config.legacy_sandbox_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: previous_model.to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: config.model_reasoning_effort.clone(), - summary: config - .model_reasoning_summary - .unwrap_or(ReasoningSummary::Auto), + summary: Some( + config + .model_reasoning_summary + .unwrap_or(ReasoningSummary::Auto), + ), }; InitialHistory::Resumed(ResumedHistory { diff --git a/codex-rs/core/tests/suite/review.rs b/codex-rs/core/tests/suite/review.rs index 5f02ba8b1d..6ab0086faf 100644 --- a/codex-rs/core/tests/suite/review.rs +++ b/codex-rs/core/tests/suite/review.rs @@ -833,7 +833,6 @@ async fn review_uses_updated_turn_permissions_and_approval_policy() { review_context.approvals_reviewer, Some(ApprovalsReviewer::User) ); - assert_eq!(review_context.personality, Some(Personality::Friendly)); // The review delegate still starts in its own default mode, not the parent's Plan mode. assert_eq!( review_context.collaboration_mode, diff --git a/codex-rs/core/tests/suite/step_settings_compaction.rs b/codex-rs/core/tests/suite/step_settings_compaction.rs index 629f115d3d..88ce4c97ef 100644 --- a/codex-rs/core/tests/suite/step_settings_compaction.rs +++ b/codex-rs/core/tests/suite/step_settings_compaction.rs @@ -1,4 +1,4 @@ -//! Compaction checkpoints retain the summary captured after a mid-turn settings update. +//! Model requests retain the summary captured after a mid-turn settings update and compaction. use super::*; use codex_history::RolloutItem; @@ -79,12 +79,14 @@ async fn compaction_preserves_updated_summary(mode: CompactionMode) -> Result<() test.codex.shutdown_and_wait().await?; let requests = responses.requests(); + assert_eq!(requests.len(), 4); assert_eq!( [ requests[0].body_json()["reasoning"]["summary"].clone(), - requests[1].body_json()["reasoning"]["summary"].clone() + requests[1].body_json()["reasoning"]["summary"].clone(), + requests[3].body_json()["reasoning"]["summary"].clone(), ], - [json!("concise"), json!("detailed")] + [json!("concise"), json!("detailed"), json!("detailed")] ); let rollout = std::fs::read_to_string(test.session_configured.rollout_path.expect("rollout path"))?; @@ -101,6 +103,6 @@ async fn compaction_preserves_updated_summary(mode: CompactionMode) -> Result<() RolloutItem::TurnContext(context) => Some(context.summary), _ => None, }); - assert_eq!(checkpoint, Some(ReasoningSummary::Detailed)); + assert_eq!(checkpoint, Some(Some(ReasoningSummary::None))); Ok(()) } diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 82f3c8f7b7..841c794d4d 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -24,7 +24,6 @@ use crate::capabilities::SelectedCapabilityRoot; use crate::config_types::ApprovalsReviewer; use crate::config_types::CollaborationMode; use crate::config_types::ModeKind; -use crate::config_types::MultiAgentMode; use crate::config_types::Personality; use crate::config_types::ReasoningSummary as ReasoningSummaryConfig; use crate::config_types::WindowsSandboxLevel; @@ -3317,12 +3316,6 @@ impl WorldStateItem { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS)] -pub struct TurnContextNetworkItem { - pub allowed_domains: Vec, - pub denied_domains: Vec, -} - /// Persist once per real user turn after computing that turn's model-visible /// context updates, and again after mid-turn compaction when replacement /// history re-establishes full context, so resume/fork replay can recover the @@ -3339,14 +3332,6 @@ pub struct TurnContextItem { #[ts(optional)] pub disabled_plugin_ids: Option>, pub cwd: AbsolutePathBuf, - /// Effective workspace roots used to materialize symbolic - /// `:workspace_roots` filesystem permissions in `permission_profile`. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_roots: Option>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub current_date: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, pub approval_policy: AskForApproval, #[serde(default, skip_serializing_if = "Option::is_none")] pub approvals_reviewer: Option, @@ -3357,33 +3342,25 @@ pub struct TurnContextItem { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub active_permission_profile: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub file_system_sandbox_policy: Option, pub model: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub comp_hash: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub personality: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub collaboration_mode: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub multi_agent_version: Option, - /// Legacy effective model-visible mode retained to deserialize older rollouts. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multi_agent_mode: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub realtime_active: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub cyber_access_program: Option, #[serde(skip_serializing_if = "Option::is_none")] pub effort: Option, - // Compatibility-only field written with a default value so older Codex - // versions can deserialize turn-context rollout items. It is no longer - // read by context reconstruction and should be removed in a future schema - // cleanup. - pub summary: ReasoningSummaryConfig, + /// Legacy placeholder written as `Some(ReasoningSummaryConfig::None)` for older readers. + /// Optional so newer readers also accept its future removal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option, } impl TurnContextItem { @@ -6197,18 +6174,18 @@ mod tests { } #[test] - fn turn_context_item_deserializes_without_network() -> Result<()> { + fn turn_context_item_deserializes_without_summary() -> Result<()> { let item: TurnContextItem = serde_json::from_value(json!({ "cwd": test_path_buf("/tmp"), "approval_policy": "never", "sandbox_policy": { "type": "danger-full-access" }, "model": "gpt-5", - "summary": "auto", }))?; - assert_eq!(item.network, None); + assert_eq!(item.summary, None); assert_eq!(item.file_system_sandbox_policy, None); assert_eq!(item.comp_hash, None); + assert_eq!(serde_json::to_value(item)?.get("summary"), None); Ok(()) } @@ -6227,24 +6204,17 @@ mod tests { } #[test] - fn turn_context_item_serializes_network_when_present() -> Result<()> { + fn turn_context_item_serializes_split_policy_and_summary() -> Result<()> { let item = TurnContextItem { turn_id: None, root_turn_id: None, disabled_plugin_ids: None, cwd: test_path_buf("/tmp").abs(), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::Never, approvals_reviewer: None, sandbox_policy: SandboxPolicy::DangerFullAccess, permission_profile: None, active_permission_profile: None, - network: Some(TurnContextNetworkItem { - allowed_domains: vec!["api.example.com".to_string()], - denied_domains: vec!["blocked.example.com".to_string()], - }), file_system_sandbox_policy: Some( FileSystemSandboxPolicy::restricted(vec![FileSystemSandboxEntry { path: FileSystemPath::GlobPattern { @@ -6258,24 +6228,15 @@ mod tests { ), model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: ReasoningSummaryConfig::Auto, + summary: Some(ReasoningSummaryConfig::None), }; let value = serde_json::to_value(item)?; - assert_eq!( - value["network"], - json!({ - "allowed_domains": ["api.example.com"], - "denied_domains": ["blocked.example.com"], - }) - ); assert_eq!( value["file_system_sandbox_policy"], json!({ @@ -6289,7 +6250,9 @@ mod tests { }] }) ); - assert_eq!(value["summary"], json!("auto")); + let legacy_summary: ReasoningSummaryConfig = + serde_json::from_value(value["summary"].clone())?; + assert_eq!(legacy_summary, ReasoningSummaryConfig::None); Ok(()) } diff --git a/codex-rs/rollout/src/recorder_tests.rs b/codex-rs/rollout/src/recorder_tests.rs index 5ae3c9c761..cb80a56bee 100644 --- a/codex-rs/rollout/src/recorder_tests.rs +++ b/codex-rs/rollout/src/recorder_tests.rs @@ -1933,26 +1933,20 @@ async fn resume_candidate_matches_cwd_reads_latest_turn_context() -> std::io::Re disabled_plugin_ids: None, cwd: serde_json::from_value(serde_json::json!(&latest_cwd)) .expect("absolute latest cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::Never, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "test-model".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }), }; writeln!(file, "{}", serde_json::to_string(&turn_context)?)?; diff --git a/codex-rs/state/src/extract.rs b/codex-rs/state/src/extract.rs index 8adeb295bc..a6109bb307 100644 --- a/codex-rs/state/src/extract.rs +++ b/codex-rs/state/src/extract.rs @@ -571,26 +571,20 @@ mod tests { .join("parent/workspace") )) .expect("absolute parent cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::Never, approvals_reviewer: None, sandbox_policy: SandboxPolicy::DangerFullAccess, permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }), "test-provider", ); @@ -621,26 +615,20 @@ mod tests { .join("workspace") )) .expect("absolute workspace cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::OnRequest, approvals_reviewer: None, sandbox_policy: SandboxPolicy::DangerFullAccess, permission_profile: Some(permission_profile.clone()), active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }), "test-provider", ); @@ -667,26 +655,20 @@ mod tests { disabled_plugin_ids: None, cwd: serde_json::from_value(serde_json::json!(&fallback_cwd)) .expect("absolute fallback cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::OnRequest, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: Some(ReasoningEffort::High), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }), "test-provider", ); @@ -710,26 +692,20 @@ mod tests { .join("fallback/workspace") )) .expect("absolute fallback cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::OnRequest, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "gpt-5".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: Some(ReasoningEffort::High), - summary: codex_protocol::config_types::ReasoningSummary::Auto, + summary: Some(codex_protocol::config_types::ReasoningSummary::Auto), }), "test-provider", ); diff --git a/codex-rs/thread-store/src/local/mod.rs b/codex-rs/thread-store/src/local/mod.rs index 983a3637b9..1380ff5bac 100644 --- a/codex-rs/thread-store/src/local/mod.rs +++ b/codex-rs/thread-store/src/local/mod.rs @@ -1077,26 +1077,20 @@ mod tests { root_turn_id: None, disabled_plugin_ids: None, cwd: serde_json::from_value(serde_json::json!(cwd)).expect("absolute cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy, approvals_reviewer: None, sandbox_policy: SandboxPolicy::DangerFullAccess, permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: model.to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: ReasoningSummary::Auto, + summary: Some(ReasoningSummary::Auto), }) }; diff --git a/codex-rs/thread-store/src/local/model_context_tests.rs b/codex-rs/thread-store/src/local/model_context_tests.rs index fe7bdc46c7..3e74f2bb2a 100644 --- a/codex-rs/thread-store/src/local/model_context_tests.rs +++ b/codex-rs/thread-store/src/local/model_context_tests.rs @@ -683,26 +683,20 @@ fn turn_context(root: &Path, turn_id: &str) -> RolloutItem { root_turn_id: None, disabled_plugin_ids: None, cwd: serde_json::from_value(serde_json::json!(root)).expect("absolute cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::Never, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "test-model".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: ReasoningSummary::Auto, + summary: Some(ReasoningSummary::Auto), }) } diff --git a/codex-rs/thread-store/src/local/rollout_migration_tests.rs b/codex-rs/thread-store/src/local/rollout_migration_tests.rs index ea49b65150..61d8a6ae44 100644 --- a/codex-rs/thread-store/src/local/rollout_migration_tests.rs +++ b/codex-rs/thread-store/src/local/rollout_migration_tests.rs @@ -2102,26 +2102,20 @@ async fn migration_compacts_subagent_prefix_and_does_not_project_it() { root_turn_id: None, disabled_plugin_ids: None, cwd: serde_json::from_value(json!(home.path())).expect("absolute cwd"), - workspace_roots: None, - current_date: None, - timezone: None, approval_policy: AskForApproval::Never, approvals_reviewer: None, sandbox_policy: SandboxPolicy::new_read_only_policy(), permission_profile: None, active_permission_profile: None, - network: None, file_system_sandbox_policy: None, model: "test-model".to_string(), comp_hash: None, - personality: None, collaboration_mode: None, multi_agent_version: None, - multi_agent_mode: None, realtime_active: None, cyber_access_program: None, effort: None, - summary: ReasoningSummary::Auto, + summary: Some(ReasoningSummary::Auto), }), user_message("child question"), agent_message("child answer"),