From 941e1dcade1598f7d10ac06b7a0c77df6857a32e Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Fri, 20 Nov 2026 22:20:38 +0000 Subject: [PATCH] Defer built-in Default mode instructions until after Plan mode (#62857) ## Why Threads that stay in Default mode carry a collaboration-mode prompt even though they have no Plan mode instructions to supersede. ## What changed Omit bundled and model-catalog Default mode instructions until a thread uses Plan mode. Emit Plan mode instructions on entry and Default mode instructions when switching back. Preserve eligible caller-provided instructions and carry the active mode through compaction and resume. ## Testing Cover prompt contents before, during, and after Plan mode in core and app-server tests, including compaction and resume in the core tests. GitOrigin-RevId: b734767da15be53c4eccae71994e46eba63a9ecc --- codex-rs/app-server/tests/prompt_prefix.rs | 30 ++- .../app-server/tests/suite/v2/turn_start.rs | 97 ++++---- .../context/world_state/collaboration_mode.rs | 35 +-- .../world_state/collaboration_mode_tests.rs | 31 +-- codex-rs/core/src/context_manager/history.rs | 6 +- codex-rs/core/src/session/mod.rs | 11 +- codex-rs/core/src/session/step_context.rs | 8 +- codex-rs/core/src/session/step_settings.rs | 11 + codex-rs/core/src/session/tests.rs | 11 + codex-rs/core/src/session/turn_context.rs | 7 +- codex-rs/core/src/session/world_state.rs | 3 +- .../tests/suite/collaboration_instructions.rs | 222 +++++++++++------- codex-rs/core/tests/suite/review.rs | 15 +- codex-rs/core/tests/suite/scenarios.rs | 12 +- ...mote__remote_board_permissions_direct.snap | 5 +- ...s__astra_active_environment_selection.snap | 18 +- ...tra_async_compaction_with_live_suffix.snap | 15 +- ...rios__astra_async_question_and_answer.snap | 5 +- ...cenarios__astra_code_mode_call_timing.snap | 26 +- ...arios__astra_disabled_executor_skills.snap | 20 +- ..._astra_executor_plugin_policy_refresh.snap | 20 +- ...rios__astra_input_interrupts_response.snap | 5 +- ...os__astra_input_yields_code_mode_cell.snap | 46 ++-- ...tra_kickoff_remote_compaction_windows.snap | 36 +-- ...a_plugin_policy_limits_visible_skills.snap | 18 +- ...gin_policy_without_skill_descriptions.snap | 18 +- ...efresh_simplified_selection_hints_off.snap | 26 +- ...refresh_simplified_selection_hints_on.snap | 26 +- ...ra_settings_release_check_tool_shapes.snap | 20 +- ...reserves_model_context_on_cold_resume.snap | 36 +-- ..._host_budget_context_after_compaction.snap | 10 +- ...etion_wakes_parent_after_final_answer.snap | 10 +- ...scenarios__code_mode_catalog_messages.snap | 20 +- ...e_mode_catalog_messages_ranked_search.snap | 20 +- ...ed_helpers__code_mode_settled_helpers.snap | 5 +- ...essions__command_sessions_world_state.snap | 49 ++-- ...ios__compaction__remote_slash_compact.snap | 98 ++------ ...ves_pending_calls_and_survives_resume.snap | 15 +- ...s_with_named_executor_request_history.snap | 20 +- ...ailure_preserves_ordinary_mcp_history.snap | 5 +- ..._preserves_history_and_ordinary_tools.snap | 10 +- ...ource_messages__mcp_resource_messages.snap | 20 +- ...arios__multi_agent_catalog_parameters.snap | 26 +- ...rios__multi_agent_native_tools_hidden.snap | 26 +- ...i_agent_native_tools_hidden_proactive.snap | 26 +- ...es_context_above_compaction_threshold.snap | 26 +- ..._child_instructions_subagent_override.snap | 19 +- ...tained_tool_output_retention_disabled.snap | 15 +- ...output_survives_compaction_and_resume.snap | 10 +- ...catalog_dedup__dedup_before_budgeting.snap | 22 +- ...log_dedup__dedup_without_descriptions.snap | 22 +- ...l_catalog_dedup__skill_catalog_deltas.snap | 72 +----- ...installation_recovery_request_history.snap | 5 +- ...sline_mention_loads_the_bundled_skill.snap | 3 +- ...3p_cache__strict_3p_mcp_catalog_cache.snap | 5 +- ...e_rechecked_without_rewriting_history.snap | 10 +- ...prefix__extension_window_prefix_local.snap | 78 ++---- ...refix__extension_window_prefix_remote.snap | 78 ++---- codex-rs/core/tests/suite/step_settings.rs | 14 +- ...ring__safety_recourse_request_history.snap | 11 +- ...ion_tests__clear_context_plan_request.snap | 5 +- 61 files changed, 530 insertions(+), 1064 deletions(-) diff --git a/codex-rs/app-server/tests/prompt_prefix.rs b/codex-rs/app-server/tests/prompt_prefix.rs index ac3134c555..cd5b767165 100644 --- a/codex-rs/app-server/tests/prompt_prefix.rs +++ b/codex-rs/app-server/tests/prompt_prefix.rs @@ -27,10 +27,9 @@ async fn prompt_prefix_matches_release() -> Result<()> { // current catalog so normal model and prompt updates cannot cause skew. let catalog_dir = TempDir::new()?; let catalog_path = catalog_dir.path().join("models.json"); - std::fs::write( - &catalog_path, - serde_json::to_vec(&codex_models_manager::bundled_models_response()?)?, - )?; + const MODEL: &str = "gpt-6-astra"; + let catalog = codex_models_manager::bundled_models_response()?; + std::fs::write(&catalog_path, serde_json::to_vec(&catalog)?)?; let mut prefixes = Vec::new(); for program in [release.as_deref(), None] { @@ -46,7 +45,7 @@ async fn prompt_prefix_matches_release() -> Result<()> { .await; let home = TempDir::new()?; MockResponsesConfig::new(&server.uri()) - .with_model("gpt-6-astra") + .with_model(MODEL) .with_root_config(&format!( "model_catalog_json = {}", serde_json::to_string(&catalog_path)? @@ -130,6 +129,27 @@ async fn prompt_prefix_matches_release() -> Result<()> { let current: Value = serde_json::from_str(&prefixes[1])?; accept_spawn_agent_shortlist_rollout(&mut released, ¤t); accept_default_tool_description_rollouts(&mut released, ¤t); + // Releases before #19024 append the catalog's Default block after permissions. + // Accept only its removal from this position in the startup developer message. + if let Some(default) = catalog + .models + .iter() + .find(|model| model.slug == MODEL) + .and_then(|model| model.model_messages.as_ref()) + .and_then(|messages| messages.collaboration_modes.as_ref()) + .and_then(|modes| modes.default.as_deref()) + && released["input"][2]["role"] == "developer" + && current.pointer("/input/2/content/1").is_none() + && let Some(content) = released["input"][2]["content"].as_array_mut() + && content.len() == 2 + && content[1] + == json!({ + "type": "input_text", + "text": format!("{default}"), + }) + { + content.pop(); + } prefixes[0] = serde_json::to_string_pretty(&released)?; } assert_eq!( diff --git a/codex-rs/app-server/tests/suite/v2/turn_start.rs b/codex-rs/app-server/tests/suite/v2/turn_start.rs index 395628a5fa..ec808da4fb 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -2630,17 +2630,10 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<( } #[tokio::test] -async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> { +async fn turn_start_applies_default_mode_instructions_only_after_plan_v2() -> Result<()> { skip_if_no_network!(Ok(())); let server = responses::start_mock_server().await; - let body = responses::sse(vec![ - responses::ev_response_created("resp-1"), - responses::ev_assistant_message("msg-1", "Done"), - responses::ev_completed("resp-1"), - ]); - let response_mock = responses::mount_sse_once(&server, body).await; - let codex_home = TempDir::new()?; MockResponsesConfig::new(&server.uri()).write(codex_home.path())?; @@ -2649,55 +2642,65 @@ async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> { .build_initialized() .await?; + let model = "mock-model-collab"; let ThreadStartResponse { thread, .. } = mcp .start_thread(ThreadStartParams { - model: Some("gpt-5.4".to_string()), + model: Some(model.to_string()), ..Default::default() }) .await?; - let collaboration_mode = CollaborationMode { - mode: ModeKind::Default, - settings: Settings { - model: "mock-model-collab".to_string(), - reasoning_effort: Some(ReasoningEffort::High), - developer_instructions: None, - }, - }; - - let _turn: TurnStartResponse = mcp - .request(|request_id| ClientRequest::TurnStart { - request_id, - params: TurnStartParams { - thread_id: thread.id.clone(), - client_user_message_id: None, - input: vec![V2UserInput::Text { - text: "Hello".to_string(), - text_elements: Vec::new(), - }], - model: Some("mock-model-override".to_string()), - effort: Some(ReasoningEffort::Low), - summary: Some(ReasoningSummary::Auto), - output_schema: None, - collaboration_mode: Some(collaboration_mode), - ..Default::default() + let plan = "# Plan Mode (Conversational)"; + let default = "# Collaboration Mode: Default"; + for (prompt, mode, expected) in [ + ("Start", None, vec![]), + ("Continue", Some(ModeKind::Default), vec![]), + ("Plan the changes", Some(ModeKind::Plan), vec![plan]), + ("Refine the plan", None, vec![plan]), + ("Implement it", Some(ModeKind::Default), vec![plan, default]), + ("Check the changes", None, vec![plan, default]), + ] { + let response_mock = responses::mount_sse_once( + &server, + responses::sse(vec![ + responses::ev_response_created(prompt), + responses::ev_completed(prompt), + ]), + ) + .await; + let collaboration_mode = mode.map(|mode| CollaborationMode { + mode, + settings: Settings { + model: model.to_string(), + reasoning_effort: Some(ReasoningEffort::High), + developer_instructions: None, }, + }); + mcp.start_turn_and_wait_for_completion(TurnStartParams { + thread_id: thread.id.clone(), + input: vec![V2UserInput::Text { + text: prompt.to_string(), + text_elements: Vec::new(), + }], + model: collaboration_mode + .as_ref() + .map(|_| "mock-model-override".to_string()), + effort: Some(ReasoningEffort::Low), + collaboration_mode, + ..Default::default() }) .await?; - timeout( - DEFAULT_READ_TIMEOUT, - mcp.read_stream_until_notification_message("turn/completed"), - ) - .await??; - - let request = response_mock.single_request(); - let payload = request.body_json(); - assert_eq!(payload["model"].as_str(), Some("mock-model-collab")); - let payload_text = payload.to_string(); - assert!(payload_text.contains( - "Use the `request_user_input` tool only when it is listed in the available tools" - )); + let request = response_mock.single_request(); + assert_eq!(request.body_json()["model"].as_str(), Some(model)); + let texts = request.message_input_texts("developer"); + let headers = texts + .iter() + .filter_map(|text| text.strip_prefix("")) + .map(|text| text.lines().next().unwrap()) + .collect::>(); + assert_eq!(headers, expected, "{prompt}"); + } Ok(()) } diff --git a/codex-rs/core/src/context/world_state/collaboration_mode.rs b/codex-rs/core/src/context/world_state/collaboration_mode.rs index d3a8b2245f..305b6f0d48 100644 --- a/codex-rs/core/src/context/world_state/collaboration_mode.rs +++ b/codex-rs/core/src/context/world_state/collaboration_mode.rs @@ -7,8 +7,8 @@ use crate::context::ContextualUserFragment; use codex_prompts::ResolvedCollaborationModeMessages; use codex_prompts::ResolvedModelMessages; use codex_prompts::without_update_plan_instructions; -use codex_protocol::config_types::CollaborationMode; use codex_protocol::config_types::ModeKind; +use codex_protocol::config_types::Settings; use codex_protocol::models::ContentItem; use codex_protocol::models::ContentItemKind; use codex_protocol::models::input_text; @@ -26,24 +26,26 @@ pub(crate) struct CollaborationModeState { impl CollaborationModeState { pub(crate) fn from_collaboration_mode( - collaboration_mode: &CollaborationMode, + mode: Option, + settings: &Settings, messages: ResolvedCollaborationModeMessages<'_>, update_plan_enabled: bool, custom_model_catalog: bool, ) -> Self { - let catalog_instructions = match collaboration_mode.mode { - ModeKind::Default => messages.default, - ModeKind::Plan => messages.plan, - } - .catalog_override(); - - let instructions = catalog_instructions.map(str::to_string).or_else(|| { - collaboration_mode - .settings - .developer_instructions - .clone() - .filter(|instructions| !instructions.is_empty()) + let bundled = ResolvedModelMessages::bundled().collaboration_modes(); + let catalog_instructions = match mode { + None => None, + Some(ModeKind::Default) => messages.default.catalog_override(), + Some(ModeKind::Plan) => messages.plan.catalog_override(), + }; + // Before Plan, preserve custom caller text only when it would win over the catalog. + let supplied = settings.developer_instructions.as_deref().filter(|text| { + !text.is_empty() + && (mode.is_some() + || (messages.default.catalog_override().is_none() + && *text != bundled.default.text())) }); + let instructions = catalog_instructions.or(supplied).map(str::to_string); let instructions = instructions.map(|instructions| { if update_plan_enabled { return instructions; @@ -55,7 +57,6 @@ impl CollaborationModeState { // preset or custom text. Compare whole strings against bundled presets // only to recognize built-in text whose disabled update_plan guidance // we can strip; custom instructions stay unchanged. - let bundled = ResolvedModelMessages::bundled().collaboration_modes(); instructions == bundled.default.text() || instructions == bundled.plan.text() } }; @@ -70,8 +71,8 @@ impl CollaborationModeState { instructions: instructions.clone().unwrap_or_default(), }; let snapshot = CollaborationModeSnapshot::Current { - mode: collaboration_mode.mode, - model: collaboration_mode.settings.model.clone(), + mode: mode.unwrap_or(ModeKind::Default), + model: settings.model.clone(), instructions: Some(WorldStateHash::from_fragment(&fragment)), }; Self { diff --git a/codex-rs/core/src/context/world_state/collaboration_mode_tests.rs b/codex-rs/core/src/context/world_state/collaboration_mode_tests.rs index 8c283f0df5..5bc7c39def 100644 --- a/codex-rs/core/src/context/world_state/collaboration_mode_tests.rs +++ b/codex-rs/core/src/context/world_state/collaboration_mode_tests.rs @@ -48,7 +48,8 @@ fn instruction_updates_are_applied_once_in_retained_history() { for instructions in [Some("old instructions"), Some("new instructions"), None] { let mut world_state = WorldState::default(); world_state.add_section(CollaborationModeState::from_collaboration_mode( - &collaboration_mode(ModeKind::Default, instructions), + Some(ModeKind::Default), + &settings(instructions), ResolvedModelMessages::bundled().collaboration_modes(), /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, @@ -101,7 +102,8 @@ fn catalog_collaboration_messages_select_mode_variant() { for (mode, expected) in [(ModeKind::Default, default), (ModeKind::Plan, plan)] { let state = CollaborationModeState::from_collaboration_mode( - &collaboration_mode(mode, Some("legacy instructions")), + Some(mode), + &settings(Some("legacy instructions")), messages, /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, @@ -119,7 +121,8 @@ fn empty_catalog_collaboration_message_suppresses_legacy_instructions() { ..ResolvedModelMessages::bundled().collaboration_modes() }; let state = CollaborationModeState::from_collaboration_mode( - &collaboration_mode(ModeKind::Plan, Some("legacy plan instructions")), + Some(ModeKind::Plan), + &settings(Some("legacy plan instructions")), messages, /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, @@ -144,7 +147,8 @@ fn missing_catalog_collaboration_message_uses_legacy_instructions() { }; for instructions in [Some("legacy plan instructions"), Some(""), None] { let state = CollaborationModeState::from_collaboration_mode( - &collaboration_mode(ModeKind::Plan, instructions), + Some(ModeKind::Plan), + &settings(instructions), messages, /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, @@ -168,7 +172,8 @@ fn legacy_collaboration_mode_snapshots_refresh_catalog_messages_once() { ..ResolvedModelMessages::bundled().collaboration_modes() }; let state = CollaborationModeState::from_collaboration_mode( - &collaboration_mode(ModeKind::Default, Some("stale legacy instructions")), + Some(ModeKind::Default), + &settings(Some("stale legacy instructions")), messages, /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, @@ -200,20 +205,18 @@ fn legacy_collaboration_mode_snapshots_refresh_catalog_messages_once() { } } -fn collaboration_mode(mode: ModeKind, instructions: Option<&str>) -> CollaborationMode { - CollaborationMode { - mode, - settings: Settings { - model: "test-model".to_string(), - reasoning_effort: None, - developer_instructions: instructions.map(str::to_string), - }, +fn settings(instructions: Option<&str>) -> Settings { + Settings { + model: "test-model".to_string(), + reasoning_effort: None, + developer_instructions: instructions.map(str::to_string), } } fn collaboration_mode_state(mode: ModeKind, instructions: &str) -> CollaborationModeState { CollaborationModeState::from_collaboration_mode( - &collaboration_mode(mode, Some(instructions)), + Some(mode), + &settings(Some(instructions)), ResolvedModelMessages::bundled().collaboration_modes(), /*update_plan_enabled*/ true, /*custom_model_catalog*/ false, diff --git a/codex-rs/core/src/context_manager/history.rs b/codex-rs/core/src/context_manager/history.rs index ffe523e613..444ea7ace8 100644 --- a/codex-rs/core/src/context_manager/history.rs +++ b/codex-rs/core/src/context_manager/history.rs @@ -584,7 +584,11 @@ impl ContextManager { } pub(crate) fn reference_context_item(&self) -> Option { - self.reference_context_item.clone() + self.reference_context_item_ref().cloned() + } + + pub(crate) fn reference_context_item_ref(&self) -> Option<&TurnContextItem> { + self.reference_context_item.as_ref() } pub(crate) fn render_step_world_state( diff --git a/codex-rs/core/src/session/mod.rs b/codex-rs/core/src/session/mod.rs index f4c49f445f..c7e3b03cd4 100644 --- a/codex-rs/core/src/session/mod.rs +++ b/codex-rs/core/src/session/mod.rs @@ -4430,15 +4430,19 @@ impl Session { // Read the step's model and record its environments together so an update cannot split them. // Match apply_turn_settings and activate_turn_environments: active_turn before state. // Wait for executor startup below, after releasing both locks. - let (mut settings, environments, inherited_environments) = { + let (mut settings, active_collaboration_mode, environments, inherited_environments) = { let _active = self .active_turn .lock() .or_cancel(cancellation_token) .await?; - let _state = self.state.lock().or_cancel(cancellation_token).await?; + let state = self.state.lock().or_cancel(cancellation_token).await?; + let settings = turn_context.next_step_settings.load_full(); + let active_collaboration_mode = + settings.active_collaboration_mode(state.history.reference_context_item_ref()); ( - turn_context.next_step_settings.load_full(), + settings, + active_collaboration_mode, self.services.turn_environments.snapshot(), self.features .enabled(Feature::SubagentThreadEnvironments) @@ -4706,6 +4710,7 @@ impl Session { } let (executor_hook_sources, mcp, tool_router, extension_data) = prepared_tools??; Ok(Arc::new(StepContext { + active_collaboration_mode, sampled_through_sequence: None, serving_assessment: None, guardian_probe: None, diff --git a/codex-rs/core/src/session/step_context.rs b/codex-rs/core/src/session/step_context.rs index 6b3e47abae..418df9616d 100644 --- a/codex-rs/core/src/session/step_context.rs +++ b/codex-rs/core/src/session/step_context.rs @@ -19,6 +19,7 @@ use codex_model_provider_info::AMAZON_BEDROCK_RUNTIME_PROVIDER_ID; use codex_model_provider_info::GCP_PROVIDER_ID; use codex_otel::SessionTelemetry; use codex_plugin::ExecutorPluginHookSource; +use codex_protocol::config_types::ModeKind; use codex_protocol::items::ModelInvocationContext; use codex_protocol::protocol::TurnContextItem; use tokio_util::sync::CancellationToken; @@ -41,6 +42,8 @@ pub(crate) struct StepContext { pub(crate) realtime: RealtimeConversationSnapshot, /// One immutable settings version captured before request preparation. pub(crate) settings: Arc, + /// None until the first Plan turn. Carried into replacement context during compaction. + pub(crate) active_collaboration_mode: Option, /// Frozen turn preferences resolved against this step's captured model. pub(crate) token_budget: Option, /// Telemetry context tagged with this sampling request's model. @@ -102,7 +105,10 @@ impl StepContext { /// Persist the context captured for this request, even after a live update. pub(crate) fn to_turn_context_item(&self) -> TurnContextItem { - let mut item = self.turn.to_turn_context_item(); + let mut item = self.turn.context_item_with_mode( + self.active_collaboration_mode + .map(|_| self.settings.effective_collaboration_mode()), + ); item.realtime_active = Some(self.realtime.active); item } diff --git a/codex-rs/core/src/session/step_settings.rs b/codex-rs/core/src/session/step_settings.rs index 203d6efc60..f5e34d74b0 100644 --- a/codex-rs/core/src/session/step_settings.rs +++ b/codex-rs/core/src/session/step_settings.rs @@ -11,6 +11,7 @@ use codex_otel::SessionTelemetry; use codex_protocol::RequestCountry; use codex_protocol::config_types::ApprovalsReviewer; use codex_protocol::config_types::CollaborationMode; +use codex_protocol::config_types::ModeKind; use codex_protocol::config_types::Personality; use codex_protocol::config_types::ReasoningSummary; use codex_protocol::config_types::SERVICE_TIER_DEFAULT_REQUEST_VALUE; @@ -18,6 +19,7 @@ use codex_protocol::config_types::ServiceTier; use codex_protocol::openai_models::CatalogModel; use codex_protocol::openai_models::ReasoningEffort; use codex_protocol::protocol::AskForApproval; +use codex_protocol::protocol::TurnContextItem; use std::sync::Arc; /// Model and execution settings selected for an individual model step within @@ -94,6 +96,15 @@ impl ResolvedStepSettings { .cloned() } + pub(super) fn active_collaboration_mode( + &self, + previous: Option<&TurnContextItem>, + ) -> Option { + let mode = self.selected.collaboration_mode.mode; + (mode == ModeKind::Plan || previous.is_some_and(|item| item.collaboration_mode.is_some())) + .then_some(mode) + } + pub(crate) fn effective_collaboration_mode(&self) -> CollaborationMode { let mut collaboration_mode = self.selected.collaboration_mode.clone(); collaboration_mode.settings.model = self.model_info.slug.clone(); diff --git a/codex-rs/core/src/session/tests.rs b/codex-rs/core/src/session/tests.rs index f73a245cb1..96fced467d 100644 --- a/codex-rs/core/src/session/tests.rs +++ b/codex-rs/core/src/session/tests.rs @@ -299,6 +299,7 @@ impl StepContext { }); settings.service_tier = turn.config.service_tier.clone(); Arc::new(Self { + active_collaboration_mode: settings.active_collaboration_mode(/*previous*/ None), sampled_through_sequence: None, turn_cancellation: tokio_util::sync::CancellationToken::new(), preempt: turn @@ -13479,3 +13480,13 @@ async fn rejected_mcp_refresh_then_corrected_user_config_blocks_ordinary_replace "rejection must not permit same-name ordinary-auth replacement in this session" ); } + +impl TurnContext { + pub(crate) fn to_turn_context_item(&self) -> TurnContextItem { + self.context_item_with_mode( + self.initial_settings + .active_collaboration_mode(/*previous*/ None) + .map(|_| self.collaboration_mode()), + ) + } +} diff --git a/codex-rs/core/src/session/turn_context.rs b/codex-rs/core/src/session/turn_context.rs index 0d44cbdbbe..c433ca36ad 100644 --- a/codex-rs/core/src/session/turn_context.rs +++ b/codex-rs/core/src/session/turn_context.rs @@ -938,7 +938,10 @@ impl TurnContext { } } - pub(crate) fn to_turn_context_item(&self) -> TurnContextItem { + pub(super) fn context_item_with_mode( + &self, + collaboration_mode: Option, + ) -> TurnContextItem { #[allow(deprecated)] let cwd = self.cwd.clone(); TurnContextItem { @@ -959,7 +962,7 @@ impl TurnContext { ), model: self.model_info().slug.clone(), comp_hash: self.model_info().comp_hash.clone(), - collaboration_mode: Some(self.collaboration_mode()), + collaboration_mode, multi_agent_version: Some(self.multi_agent_version), realtime_active: Some(self.realtime_active), cyber_access_program: self.cyber_access_program, diff --git a/codex-rs/core/src/session/world_state.rs b/codex-rs/core/src/session/world_state.rs index 1da56cc955..a41894d146 100644 --- a/codex-rs/core/src/session/world_state.rs +++ b/codex-rs/core/src/session/world_state.rs @@ -342,7 +342,8 @@ impl Session { } if turn_context.config.include_collaboration_mode_instructions { world_state.add_section(CollaborationModeState::from_collaboration_mode( - &settings.effective_collaboration_mode(), + step_context.active_collaboration_mode, + &settings.effective_collaboration_mode().settings, model_messages.collaboration_modes(), turn_context.config.update_plan_enabled, turn_context.config.model_catalog.is_some(), diff --git a/codex-rs/core/tests/suite/collaboration_instructions.rs b/codex-rs/core/tests/suite/collaboration_instructions.rs index 731c2c1d79..731e8e1e4c 100644 --- a/codex-rs/core/tests/suite/collaboration_instructions.rs +++ b/codex-rs/core/tests/suite/collaboration_instructions.rs @@ -159,81 +159,78 @@ async fn catalog_collaboration_messages_track_mode_changes() -> Result<()> { skip_if_no_network!(Ok(())); let server = start_mock_server().await; - let req1 = mount_sse_once( - &server, - sse(vec![ev_response_created("resp-1"), ev_completed("resp-1")]), - ) - .await; - let req2 = mount_sse_once( - &server, - sse(vec![ev_response_created("resp-2"), ev_completed("resp-2")]), - ) - .await; - let model_slug = "catalog-collaboration-model"; let default_text = "## Plan tool\nPreserve the custom default policy.\n"; let plan_text = "## `update_plan`\nPreserve the custom Plan Mode policy.\n"; - let model = model_with_collaboration_messages(model_slug, Some(default_text), Some(plan_text)); - let mut builder = test_codex() - .with_model(model_slug) - .with_config(move |config| { - config.model_catalog = Some(ModelsResponse { - models: vec![model], - }); - }); - let test = builder.build(&server).await?; - - core_test_support::submit_thread_settings( - &test.codex, - ThreadSettingsOverrides { - collaboration_mode: Some(collab_mode_for_model( - ModeKind::Default, - model_slug, - Some("legacy default instructions"), - )), - ..Default::default() - }, - ) - .await?; - test.submit_text_turn("default turn").await?; - - let first_dev_texts = developer_texts(&req1.single_request().input()); - assert_eq!( - count_messages_containing(&first_dev_texts, &collab_xml(default_text)), - 1 - ); - assert_eq!( - count_messages_containing(&first_dev_texts, "legacy default instructions"), - 0 - ); - - core_test_support::submit_thread_settings( - &test.codex, - ThreadSettingsOverrides { - collaboration_mode: Some(collab_mode_for_model( - ModeKind::Plan, - model_slug, - Some("legacy plan instructions"), - )), - ..Default::default() - }, - ) - .await?; - test.submit_text_turn("plan turn").await?; - - let second_dev_texts = developer_texts(&req2.single_request().input()); - assert_eq!( - count_messages_containing(&second_dev_texts, &collab_xml(default_text)), - 1 - ); - assert_eq!( - count_messages_containing(&second_dev_texts, &collab_xml(plan_text)), - 1 - ); - assert_eq!( - count_messages_containing(&second_dev_texts, "legacy plan instructions"), - 0 - ); + let builder = || { + let mut model = + model_with_collaboration_messages(model_slug, Some(default_text), Some(plan_text)); + model.auto_compact_token_limit = Some(50_000); + test_codex() + .with_model(model_slug) + .with_config(move |config| { + config.model_catalog = Some(ModelsResponse { + models: vec![model], + }); + }) + }; + let mut test = builder().build_with_auto_env(&server).await?; + let fallback = "legacy caller instructions"; + let mut compact = false; + for (turn, mode, tokens, resume, expected) in [ + ("startup", ModeKind::Default, 10, false, (0, 0)), + ("resume before Plan", ModeKind::Default, 10, true, (0, 0)), + ("plan", ModeKind::Plan, 60_000, false, (1, 0)), + ("exit Plan", ModeKind::Default, 60_000, false, (0, 1)), + ("continue", ModeKind::Default, 10, false, (0, 1)), + ("resume after Plan", ModeKind::Default, 10, true, (0, 1)), + ] { + core_test_support::submit_thread_settings( + &test.codex, + ThreadSettingsOverrides { + collaboration_mode: Some(collab_mode_for_model(mode, model_slug, Some(fallback))), + ..Default::default() + }, + ) + .await?; + if resume { + test = builder().restart_with_auto_env(&server, &test).await?; + } + if compact { + mount_sse_once( + &server, + sse(vec![ + ev_response_created("compact"), + json!({ + "type": "response.output_item.done", + "item": {"type": "compaction", "encrypted_content": "summary"}, + }), + ev_completed("compact"), + ]), + ) + .await; + } + compact = tokens > 50_000; + let response = mount_sse_once( + &server, + sse(vec![ + ev_response_created(turn), + core_test_support::responses::ev_completed_with_tokens(turn, tokens), + ]), + ) + .await; + test.submit_text_turn(turn).await?; + let texts = developer_texts(&response.single_request().input()); + assert_eq!( + ( + count_messages_containing(&texts, &collab_xml(plan_text)), + count_messages_containing(&texts, &collab_xml(default_text)) + ), + expected, + "{turn}" + ); + assert_eq!(count_messages_containing(&texts, fallback), 0, "{turn}"); + } Ok(()) } @@ -281,6 +278,27 @@ async fn catalog_collaboration_messages_refresh_without_mode_or_model_change( .build_with_auto_env(&server) .await?; + if mode == ModeKind::Default { + core_test_support::submit_thread_settings( + &test.codex, + ThreadSettingsOverrides { + collaboration_mode: Some(collab_mode_for_model( + ModeKind::Plan, + MODEL, + /*instructions*/ None, + )), + ..Default::default() + }, + ) + .await?; + mount_sse_once( + &server, + sse(vec![ev_response_created("plan"), ev_completed("plan")]), + ) + .await; + test.submit_text_turn("plan").await?; + } + core_test_support::submit_thread_settings( &test.codex, ThreadSettingsOverrides { @@ -326,7 +344,12 @@ async fn catalog_collaboration_messages_refresh_without_mode_or_model_change( .0 }) .collect::>(); - assert_eq!(collaboration_instructions.as_slice(), expected, "{turn}"); + let mut expected_history = Vec::new(); + if mode == ModeKind::Default { + expected_history.push(INACTIVE); + } + expected_history.extend_from_slice(expected); + assert_eq!(collaboration_instructions, expected_history, "{turn}"); requests.push(request); } @@ -360,11 +383,10 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once( let server = start_mock_server().await; let model_slug = "catalog-collaboration-clear-model"; let empty_model_slug = "catalog-collaboration-empty-model"; - let default_text = "catalog default instructions"; + let plan_text = "catalog plan instructions"; let fallback_text = "legacy fallback instructions"; let fallback = empty_instructions.map(|_| fallback_text); - let model = - model_with_collaboration_messages(model_slug, Some(default_text), empty_instructions); + let model = model_with_collaboration_messages(model_slug, empty_instructions, Some(plan_text)); let empty_model = model_with_collaboration_messages(empty_model_slug, empty_instructions, empty_instructions); let mut builder = test_codex() @@ -377,11 +399,11 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once( let test = builder.build_with_auto_env(&server).await?; for (turn, mode, model, clear_count) in [ - ("default", ModeKind::Default, model_slug, 0), - ("clear", ModeKind::Plan, model_slug, 1), - ("still-clear", ModeKind::Plan, model_slug, 1), - ("change-model", ModeKind::Plan, empty_model_slug, 1), - ("change-mode", ModeKind::Default, empty_model_slug, 1), + ("plan", ModeKind::Plan, model_slug, 0), + ("clear", ModeKind::Default, model_slug, 1), + ("still-clear", ModeKind::Default, model_slug, 1), + ("change-model", ModeKind::Default, empty_model_slug, 1), + ("change-mode", ModeKind::Plan, empty_model_slug, 1), ] { let response = mount_sse_once( &server, @@ -401,7 +423,7 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once( let dev_texts = response.single_request().message_input_texts("developer"); assert_eq!( ( - count_messages_containing(&dev_texts, &collab_xml(default_text)), + count_messages_containing(&dev_texts, &collab_xml(plan_text)), count_messages_containing(&dev_texts, &collab_xml("")), count_messages_containing(&dev_texts, fallback_text), ), @@ -433,9 +455,10 @@ async fn model_change_appends_new_catalog_collaboration_message() -> Result<()> let second_slug = "catalog-collaboration-model-b"; let first_text = "model A collaboration instructions"; let second_text = "model B collaboration instructions"; - let first = model_with_collaboration_messages(first_slug, Some(first_text), /*plan*/ None); + let first = + model_with_collaboration_messages(first_slug, /*default*/ None, Some(first_text)); let second = - model_with_collaboration_messages(second_slug, Some(second_text), /*plan*/ None); + model_with_collaboration_messages(second_slug, /*default*/ None, Some(second_text)); let mut builder = test_codex() .with_model(first_slug) .with_config(move |config| { @@ -449,7 +472,7 @@ async fn model_change_appends_new_catalog_collaboration_message() -> Result<()> &test.codex, ThreadSettingsOverrides { collaboration_mode: Some(collab_mode_for_model( - ModeKind::Default, + ModeKind::Plan, first_slug, Some("legacy instructions"), )), @@ -1013,9 +1036,8 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once( const MODEL: &str = "catalog-collaboration-resume-model"; const ORIGINAL: &str = "original collaboration instructions"; const CURRENT: &str = "current collaboration instructions"; - let builder_with_instructions = |instructions: &str| { - let model = - model_with_collaboration_messages(MODEL, Some(instructions), /*plan*/ None); + let builder_with_instructions = |instructions| { + let model = model_with_collaboration_messages(MODEL, instructions, /*plan*/ None); test_codex().with_model(MODEL).with_config(move |config| { config.model_catalog = Some(ModelsResponse { models: vec![model], @@ -1032,9 +1054,21 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once( ]), ) .await; - let initial = builder_with_instructions(ORIGINAL) + let initial = builder_with_instructions(None) .build_with_auto_env(&server) .await?; + core_test_support::submit_thread_settings( + &initial.codex, + ThreadSettingsOverrides { + collaboration_mode: Some(collab_mode_for_model( + ModeKind::Default, + MODEL, + Some(ORIGINAL), + )), + ..Default::default() + }, + ) + .await?; initial.submit_text_turn("before upgrading").await?; let home = initial.home.clone(); @@ -1049,6 +1083,14 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once( .lines() .map(|original_line| { let mut line = codex_rollout::parse_rollout_line(original_line)?; + if let RolloutItem::TurnContext(context) = &mut line.item { + context.collaboration_mode = Some(collab_mode_for_model( + ModeKind::Default, + MODEL, + Some(ORIGINAL), + )); + return serde_json::to_string(&line); + } if let RolloutItem::WorldState(world_state) = &mut line.item && let Some(snapshot) = world_state.state.get_mut("collaboration_mode") { @@ -1067,7 +1109,7 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once( ); std::fs::write(&rollout_path, format!("{legacy_rollout}\n"))?; - let resumed = builder_with_instructions(CURRENT) + let resumed = builder_with_instructions(Some(CURRENT)) .resume(&server, home, rollout_path) .await?; let mut previous_input = initial_response.single_request().input(); diff --git a/codex-rs/core/tests/suite/review.rs b/codex-rs/core/tests/suite/review.rs index 3af9090354..acc1176485 100644 --- a/codex-rs/core/tests/suite/review.rs +++ b/codex-rs/core/tests/suite/review.rs @@ -834,18 +834,9 @@ async fn review_uses_updated_turn_permissions_and_approval_policy() { review_context.approvals_reviewer, Some(ApprovalsReviewer::User) ); - // The review delegate still starts in its own default mode, not the parent's Plan mode. - assert_eq!( - review_context.collaboration_mode, - Some(CollaborationMode { - mode: ModeKind::Default, - settings: Settings { - model: "gpt-5.4".to_string(), - reasoning_effort: Some(ReasoningEffort::Medium), - developer_instructions: None, - }, - }) - ); + assert_eq!(review_context.collaboration_mode, None); + assert_eq!(review_context.model, "gpt-5.4"); + assert_eq!(review_context.effort, Some(ReasoningEffort::Medium)); let _codex_home_guard = codex_home; server.verify().await; diff --git a/codex-rs/core/tests/suite/scenarios.rs b/codex-rs/core/tests/suite/scenarios.rs index bd89f6fbfd..0939a500d8 100644 --- a/codex-rs/core/tests/suite/scenarios.rs +++ b/codex-rs/core/tests/suite/scenarios.rs @@ -4299,13 +4299,15 @@ async fn astra_async_compaction_keeps_work_added_after_its_snapshot( assert_eq!(positions.len(), 1, "{text}"); positions[0] }; - let default = position("# Collaboration Mode: Default"); + let permissions = position(""); let draft = position("Draft the launch notes."); let compaction = position("ASYNC_LAUNCH_CHECKPOINT"); let plan = position("Plan Mode"); if matches!(suffix, LiveSuffix::User) { let user = position("Check who can finish the notes."); - assert!(draft < compaction && compaction < default && default < plan && plan < user); + assert!( + draft < compaction && compaction < permissions && permissions < plan && plan < user + ); let entries = requests.iter().map(SnapshotEntry::body).collect::>(); insta::assert_snapshot!( "astra_async_compaction_with_live_suffix", @@ -4321,9 +4323,11 @@ async fn astra_async_compaction_keeps_work_added_after_its_snapshot( suffix, LiveSuffix::RetainedTool | LiveSuffix::OverBudgetRetainedTool ) { - assert!(draft < compaction && compaction < default && default < plan && plan < tool); + assert!( + draft < compaction && compaction < permissions && permissions < plan && plan < tool + ); } else { - assert!(default < draft && draft < compaction && compaction < plan && plan < tool); + assert!(permissions < draft && draft < compaction && compaction < plan && plan < tool); } let assistant = position("I will check who is available."); let call = input diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_permissions_direct.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_permissions_direct.snap index bd9b007f76..97dcc2bee7 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_permissions_direct.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_permissions_direct.snap @@ -35,9 +35,8 @@ Scenario: Permission discovery preserves legacy output, exposes reply-only acces - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_active_environment_selection.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_active_environment_selection.snap index 2444544584..fb0b40caf7 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_active_environment_selection.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_active_environment_selection.snap @@ -39,7 +39,7 @@ Scenario: Astra sees two environments with different permissions. Only the secon A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] @@ -74,22 +74,6 @@ Scenario: Astra sees two environments with different permissions. Only the secon - ["cargo", "test"] The writable root is ``. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_compaction_with_live_suffix.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_compaction_with_live_suffix.snap index c41bf87ef1..a858bcd113 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_compaction_with_live_suffix.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_compaction_with_live_suffix.snap @@ -23,10 +23,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] - [02] - [03] install_budget: 400 tokens remain. + [02] install_budget: 400 tokens remain. 03:message/developer: 04:message/developer: @@ -62,10 +61,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] - [02] - [03] install_budget: 400 tokens remain. + [02] install_budget: 400 tokens remain. 03:message/developer: 04:message/developer: @@ -108,10 +106,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us 02:message/user: Draft the launch notes. 03:compaction:encrypted=true; chars=23; hash=159cfcb231cc70f0 -04:message/developer[3]: +04:message/developer[2]: [01] - [02] - [03] install_budget: 400 tokens remain. + [02] install_budget: 400 tokens remain. 05:message/developer: 06:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_question_and_answer.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_question_and_answer.snap index bf3eb75290..1fb4ace9c3 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_question_and_answer.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_async_question_and_answer.snap @@ -23,9 +23,8 @@ Scenario: Astra uses the catalog question schema to ask who a launch update is f - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_code_mode_call_timing.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_code_mode_call_timing.snap index 53ab286cb0..651068c837 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_code_mode_call_timing.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_code_mode_call_timing.snap @@ -39,27 +39,11 @@ Scenario: Astra reads code-mode timings and the collector notice even at zero to A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_disabled_executor_skills.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_disabled_executor_skills.snap index 6dbe7030ac..b5b68cd105 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_disabled_executor_skills.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_disabled_executor_skills.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] # Escalation Requests @@ -67,23 +67,7 @@ Settings: - ["gh", "pr", "check"] - ["cargo", "test"] - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06] ### Skill roots diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_executor_plugin_policy_refresh.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_executor_plugin_policy_refresh.snap index 3de0473247..6cd489cf70 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_executor_plugin_policy_refresh.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_executor_plugin_policy_refresh.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] # Escalation Requests @@ -67,23 +67,7 @@ Settings: - ["gh", "pr", "check"] - ["cargo", "test"] - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06] ### Skill roots diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_interrupts_response.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_interrupts_response.snap index 8b38e7b708..7a045679f3 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_interrupts_response.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_interrupts_response.snap @@ -23,9 +23,8 @@ Scenario: Astra receives new user input after its unfinished response is interru - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_yields_code_mode_cell.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_yields_code_mode_cell.snap index ad03bdb398..50624c72af 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_yields_code_mode_cell.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_input_yields_code_mode_cell.snap @@ -39,40 +39,24 @@ Scenario: Astra continues after new user input yields a running code cell, then A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] - # Escalation Requests +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] + # Escalation Requests - Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb] + Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb] - - Pipes: | - - Logical operators: &&, || - - NEVER provide a prefix_rule if your command uses a heredoc or herestring. + - Pipes: | + - Logical operators: &&, || + + NEVER provide a prefix_rule if your command uses a heredoc or herestring. - ### Examples - Good examples of prefixes: - - ["npm", "run", "dev"] - - ["gh", "pr", "check"] - - ["cargo", "test"] - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - + ### Examples + Good examples of prefixes: + - ["npm", "run", "dev"] + - ["gh", "pr", "check"] + - ["cargo", "test"] + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_kickoff_remote_compaction_windows.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_kickoff_remote_compaction_windows.snap index 26c47317e7..32c9da54bf 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_kickoff_remote_compaction_windows.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_kickoff_remote_compaction_windows.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] ## Skills A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b] @@ -79,22 +79,6 @@ Settings: - ["gh", "pr", "check"] - ["cargo", "test"] - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -223,7 +207,7 @@ Settings: same as window 1 02:message/user: Plan a team kickoff for Friday using $outline and $calendar:agenda. -03:message/developer[3]: +03:message/developer[2]: [01] ## Skills A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b] @@ -253,22 +237,6 @@ Settings: same as window 1 - ["gh", "pr", "check"] - ["cargo", "test"] - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 04:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_limits_visible_skills.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_limits_visible_skills.snap index a2c544b9a6..61e38088f0 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_limits_visible_skills.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_limits_visible_skills.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] ## Skills A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b] @@ -65,22 +65,6 @@ Settings: Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_without_skill_descriptions.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_without_skill_descriptions.snap index 2a3e8aa35f..089bd614e2 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_without_skill_descriptions.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_policy_without_skill_descriptions.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] ## Skills A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=d516c00c9246c269] @@ -65,22 +65,6 @@ Settings: Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_off.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_off.snap index 366f577373..5ead9c41b1 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_off.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_off.snap @@ -49,27 +49,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_on.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_on.snap index 3e17661c46..b03501555c 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_on.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_plugin_refresh_simplified_selection_hints_on.snap @@ -49,27 +49,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_settings_release_check_tool_shapes.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_settings_release_check_tool_shapes.snap index eaea544f25..10905dc86a 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_settings_release_check_tool_shapes.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__astra_settings_release_check_tool_shapes.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] Deferred tool namespaces: - mcp__rmcp: Use these tools to exercise the rmcp test server. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__attached_side_chat_preserves_model_context_on_cold_resume.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__attached_side_chat_preserves_model_context_on_cold_resume.snap index f67ca8ad25..76448cb143 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__attached_side_chat_preserves_model_context_on_cold_resume.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__attached_side_chat_preserves_model_context_on_cold_resume.snap @@ -39,7 +39,7 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn, A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Use plain language. [02] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] @@ -58,22 +58,6 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn, - ["gh", "pr", "check"] - ["cargo", "test"] - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -141,7 +125,7 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn, A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Use plain language. [02] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] @@ -160,22 +144,6 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn, - ["gh", "pr", "check"] - ["cargo", "test"] - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__budget_context__host_budget_context_after_compaction.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__budget_context__host_budget_context_after_compaction.snap index bd88db3096..e6e316ef30 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__budget_context__host_budget_context_after_compaction.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__budget_context__host_budget_context_after_compaction.snap @@ -23,9 +23,8 @@ Scenario: Core renders the host's roster with native World State cadence. Compac - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -84,9 +83,8 @@ Scenario: Core renders the host's roster with native World State cadence. Compac Start planning the release. 03:message/user: Continue planning. -04:message/developer[2]: - [01] - [02] +04:message/developer: + 05:message/developer: 06:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__child_completion_wakes_parent_after_final_answer.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__child_completion_wakes_parent_after_final_answer.snap index ca1c9f8599..051946c3cd 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__child_completion_wakes_parent_after_final_answer.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__child_completion_wakes_parent_after_final_answer.snap @@ -33,9 +33,8 @@ Settings: - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -70,9 +69,8 @@ Settings: same as window 1 - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages.snap index c5e4f35726..2c4a4520d1 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -01:message/developer[3]: +01:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] Deferred tool namespaces: - mcp__codex_apps__calendar: Plan events and manage your calendar. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages_ranked_search.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages_ranked_search.snap index c7f9ee1a0d..bb37f0105c 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages_ranked_search.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_catalog_messages_ranked_search.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -01:message/developer[3]: +01:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] Deferred tool namespaces: - mcp__codex_apps__calendar: Plan events and manage your calendar. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_settled_helpers__code_mode_settled_helpers.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_settled_helpers__code_mode_settled_helpers.snap index 82038f55b7..41e5943f45 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_settled_helpers__code_mode_settled_helpers.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__code_mode_settled_helpers__code_mode_settled_helpers.snap @@ -23,9 +23,8 @@ Scenario: Settlement helpers deliver fulfilled and rejected records with input i - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__command_sessions__command_sessions_world_state.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__command_sessions__command_sessions_world_state.snap index 24cd56d7e1..eab992915d 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__command_sessions__command_sessions_world_state.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__command_sessions__command_sessions_world_state.snap @@ -23,13 +23,12 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] None. [02] - [03] 03:message/developer: 04:message/developer: @@ -75,13 +74,12 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] None. [02] - [03] 03:message/developer: 04:message/developer: @@ -120,13 +118,11 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi The current model is no-command-polling. -16:message/developer: - -17:message/user: +16:message/user: Check the command while polling is unavailable. -18:configuration_update:reasoning={"effort":"low"} +17:configuration_update:reasoning={"effort":"low"} -- request 5 (compaction) -- -19:compaction_trigger +18:compaction_trigger ## Window 3 (after request 5: input diverged at item 00, settings changed (model)) -- request 6 (turn) -- @@ -151,14 +147,13 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi Start the command and print only its output. 03:message/user: Keep the command running. -04:message/developer[3]: +04:message/developer[2]: [01] Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] write_stdin is unavailable with the current tool set. 1000: running [02] - [03] 05:message/developer: 06:message/developer: @@ -182,56 +177,54 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi The current model is gpt-6-astra. -14:message/developer: - -15:message/user: +14:message/user: Check the command after compaction with polling restored. -- request 7 (turn) -- -16:message/developer: +15:message/developer: Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] 1000: exited; poll to collect -17:message/user: +16:message/user: Check the command after it exits. -- request 8 (turn) -- -18:message/user: +17:message/user: Collect the final command result. -- request 9 (turn) -- -19:custom_tool_call/exec:const result = await tools.write_stdin({session_id: 1000, chars: ""}); text({output: result.output, exit_code: result.exit_code}); -20:custom_tool_call_output:Script completed +18:custom_tool_call/exec:const result = await tools.write_stdin({session_id: 1000, chars: ""}); text({output: result.output, exit_code: result.exit_code}); +19:custom_tool_call_output:Script completed Wall time seconds Output: | {"output":"finished","exit_code":7} -21:message/developer: +20:message/developer: Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] None. -- request 10 (turn) -- -22:message/user: +21:message/user: Start another command before restarting. -- request 11 (turn) -- -23:custom_tool_call/exec:// @exec: {"yield_time_ms": 30000} +22:custom_tool_call/exec:// @exec: {"yield_time_ms": 30000} const result = await tools.exec_command({cmd: "while [ ! -f release-second-command ]; do sleep 0.02; don...inished; exit 7", login: false, yield_time_ms: 250}); [hash=f914f064e7e2bfce] text(result.output); -24:custom_tool_call_output:Script completed +23:custom_tool_call_output:Script completed Wall time seconds Output: -25:message/developer: +24:message/developer: Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] 1001: running -- request 12 (turn) -- -26:message/developer: +25:message/developer: Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976] None. -27:message/user: +26:message/user: -28:message/user: +27:message/user: Check command sessions after restarting. -29:configuration_update:reasoning={"effort":"low"} +28:configuration_update:reasoning={"effort":"low"} diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__remote_slash_compact.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__remote_slash_compact.snap index 2278efdefe..2047a3c206 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__remote_slash_compact.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__remote_slash_compact.snap @@ -49,27 +49,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -145,27 +129,11 @@ Settings: same as window 1 A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -238,40 +206,24 @@ Settings: same as window 1 A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] - # Escalation Requests +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] + # Escalation Requests - Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb] + Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb] - - Pipes: | - - Logical operators: &&, || - - NEVER provide a prefix_rule if your command uses a heredoc or herestring. + - Pipes: | + - Logical operators: &&, || + + NEVER provide a prefix_rule if your command uses a heredoc or herestring. - ### Examples - Good examples of prefixes: - - ["npm", "run", "dev"] - - ["gh", "pr", "check"] - - ["cargo", "test"] - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - + ### Examples + Good examples of prefixes: + - ["npm", "run", "dev"] + - ["gh", "pr", "check"] + - ["cargo", "test"] + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__dynamic_tools__dynamic_tools_update_preserves_pending_calls_and_survives_resume.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__dynamic_tools__dynamic_tools_update_preserves_pending_calls_and_survives_resume.snap index ed9a23ac85..927a4ad769 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__dynamic_tools__dynamic_tools_update_preserves_pending_calls_and_survives_resume.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__dynamic_tools__dynamic_tools_update_preserves_pending_calls_and_survives_resume.snap @@ -37,9 +37,8 @@ Settings: -- request 1 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: @@ -56,9 +55,8 @@ Settings: relative to window 1 -- request 2 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: @@ -85,9 +83,8 @@ Settings: relative to window 2 -- request 5 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__frozen_cloud_skills__frozen_cloud_skills_with_named_executor_request_history.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__frozen_cloud_skills__frozen_cloud_skills_with_named_executor_request_history.snap index c85ebfdad7..1716843011 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__frozen_cloud_skills__frozen_cloud_skills_with_named_executor_request_history.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__frozen_cloud_skills__frozen_cloud_skills_with_named_executor_request_history.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06] ### Skill roots diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_failure_preserves_ordinary_mcp_history.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_failure_preserves_ordinary_mcp_history.snap index 419fb17ffe..7a667cffa5 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_failure_preserves_ordinary_mcp_history.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_failure_preserves_ordinary_mcp_history.snap @@ -43,9 +43,8 @@ Settings: -- request 1 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_revocation_preserves_history_and_ordinary_tools.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_revocation_preserves_history_and_ordinary_tools.snap index 3ec48ae763..353d068038 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_revocation_preserves_history_and_ordinary_tools.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_ema__enterprise_revocation_preserves_history_and_ordinary_tools.snap @@ -47,9 +47,8 @@ Settings: -- request 1 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: @@ -72,9 +71,8 @@ Settings: relative to window 1 -- request 3 (turn) -- 00:message/developer: -01:message/developer[2]: - [01] - [02] +01:message/developer: + 02:message/developer: 03:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_resource_messages__mcp_resource_messages.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_resource_messages__mcp_resource_messages.snap index 541550d009..6b58eef9a4 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_resource_messages__mcp_resource_messages.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__mcp_resource_messages__mcp_resource_messages.snap @@ -48,28 +48,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -01:message/developer[3]: +01:message/developer[2]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] Deferred tool namespaces: - mcp__resources: Use these tools to exercise the rmcp test server. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_catalog_parameters.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_catalog_parameters.snap index 42680fb14f..02849aa271 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_catalog_parameters.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_catalog_parameters.snap @@ -49,27 +49,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden.snap index b7d6bd8bd5..2352361684 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden.snap @@ -42,27 +42,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: Any earlier instruction enabling proactive multi-agent delegation no longer applies. Do not spawn sub-ag...k for sub-agents, delegation, or parallel agent work. [hash=6e1e1baf5a87faf5] diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden_proactive.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden_proactive.snap index 17333c553f..9f36a5d44e 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden_proactive.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__multi_agent_native_tools_hidden_proactive.snap @@ -42,27 +42,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:message/developer: Proactive multi-agent delegation is active. Any earlier developer instruction requiring an explicit user...message changes it. User requests override this hint. [hash=0917619915af4b51] diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__prediction_fork_preserves_context_above_compaction_threshold.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__prediction_fork_preserves_context_above_compaction_threshold.snap index 4eacde0df4..19ebf0c5e8 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__prediction_fork_preserves_context_above_compaction_threshold.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__prediction_fork_preserves_context_above_compaction_threshold.snap @@ -50,27 +50,11 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +02:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 03:function_call_output/agent.thread_hint:Agent name: /root First context window id: Current context window id: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__reserved_spawn__prepared_child_instructions_subagent_override.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__reserved_spawn__prepared_child_instructions_subagent_override.snap index 0780dbe542..8403bfdb8a 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__reserved_spawn__prepared_child_instructions_subagent_override.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__reserved_spawn__prepared_child_instructions_subagent_override.snap @@ -1,6 +1,5 @@ --- source: core/tests/suite/scenarios_reserved_spawn.rs -assertion_line: 264 expression: "context_snapshot::format_request_history_snapshot(\"Host preparation preserves custom base instructions and applies the native subagent developer override when starting a child with a different model.\",\n&requests, &ContextSnapshotOptions::default().include_request_settings(),)" --- Scenario: Host preparation preserves custom base instructions and applies the native subagent developer override when starting a child with a different model. @@ -27,7 +26,7 @@ Settings: - function/sleep 01:message/developer: Keep the custom base instructions. -02:message/developer[3]: +02:message/developer[2]: [01] Explain the reasoning behind your findings. [02] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c] @@ -46,22 +45,6 @@ Settings: - ["gh", "pr", "check"] - ["cargo", "test"] - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: Any earlier instruction enabling proactive multi-agent delegation no longer applies. Do not spawn sub-ag...k for sub-agents, delegation, or parallel agent work. [hash=6e1e1baf5a87faf5] diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_retention_disabled.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_retention_disabled.snap index a3c72ed8a8..8670ae0067 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_retention_disabled.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_retention_disabled.snap @@ -23,9 +23,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -62,9 +61,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -101,9 +99,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_survives_compaction_and_resume.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_survives_compaction_and_resume.snap index f8c8b21317..b3319f304b 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_survives_compaction_and_resume.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__retained_tool_outputs__retained_tool_output_survives_compaction_and_resume.snap @@ -23,9 +23,8 @@ Scenario: Retained thread instructions stop emergency tool-output trimming. Comp - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -65,9 +64,8 @@ Scenario: Retained thread instructions stop emergency tool-output trimming. Comp - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_before_budgeting.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_before_budgeting.snap index 36dbfc1e1b..0119aed51f 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_before_budgeting.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_before_budgeting.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[4]: +02:message/developer[3]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06] ### Skill roots @@ -81,7 +65,7 @@ Settings: - other:s1: Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidan...ce. UNIQUE_DESCRIPTION_END (executor package: e1/s1) [hash=d8432891813affeb] - other:s2: Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidan...ce. UNIQUE_DESCRIPTION_END (executor package: e1/s2) [hash=1c05fa218dd21e8f] - [04] + [03] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...urce` locators use their provider's access mechanism. [hash=b6782e3abdba03b2] Read a skill package directly with `skills.read({"package":""})` to read its `SKILL.md`; root a...ackage is not provided, use `skills.list` to find it. [hash=25bf84ea2123d647] diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_without_descriptions.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_without_descriptions.snap index 4a16d6151d..69fbcc93e9 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_without_descriptions.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__dedup_without_descriptions.snap @@ -49,28 +49,12 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[4]: +02:message/developer[3]: [01] Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - - [03] + [02] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=18b83353757fba24] ### Skill roots @@ -81,7 +65,7 @@ Settings: - other:s1: (executor package: e1/s1) - other:s2: (executor package: e1/s2) - [04] + [03] ## Skills A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...urce` locators use their provider's access mechanism. [hash=97229b4ea8d5a55c] Read a skill package directly with `skills.read({"package":""})` to read its `SKILL.md`; root a...ackage is not provided, use `skills.list` to find it. [hash=25bf84ea2123d647] diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__skill_catalog_deltas.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__skill_catalog_deltas.snap index ce633e6c26..00f81eeee0 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__skill_catalog_deltas.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_catalog_dedup__skill_catalog_deltas.snap @@ -49,7 +49,7 @@ Settings: A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f] -02:message/developer[3]: +02:message/developer[2]: [01] ## Host skills @@ -71,22 +71,6 @@ Settings: Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 03:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -203,7 +187,7 @@ Settings: same as window 1 List the available skills after removing browser-testing. 06:message/user: Continue with the same skills. -07:message/developer[3]: +07:message/developer[2]: [01] ## Host skills @@ -225,22 +209,6 @@ Settings: same as window 1 Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 08:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -344,7 +312,7 @@ Settings: same as window 1 Continue after compaction. 09:message/user: Continue with a smaller skills list budget. -10:message/developer[3]: +10:message/developer[2]: [01] ## Host skills @@ -366,22 +334,6 @@ Settings: same as window 1 Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 11:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -497,7 +449,7 @@ Settings: same as window 1 Check the updated code-review skill. 15:message/user: Continue after removing more skills. -16:message/developer[3]: +16:message/developer[2]: [01] ## Host skills @@ -517,22 +469,6 @@ Settings: same as window 1 Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - [03] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - 17:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_read_installation_recovery_request_history.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_read_installation_recovery_request_history.snap index a137987fc5..7d34aca660 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_read_installation_recovery_request_history.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__skill_read_installation_recovery_request_history.snap @@ -23,10 +23,9 @@ Scenario: Astra reads Cloud instructions, discovers an omitted deployment instal - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] - [02] - [03] + [02] 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__statusline_authoring__explicit_statusline_mention_loads_the_bundled_skill.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__statusline_authoring__explicit_statusline_mention_loads_the_bundled_skill.snap index 765784d052..b7cdb29620 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__statusline_authoring__explicit_statusline_mention_loads_the_bundled_skill.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__statusline_authoring__explicit_statusline_mention_loads_the_bundled_skill.snap @@ -23,10 +23,9 @@ Scenario: A user requests the bundled statusline skill by name. - function/wait_agent 01:message/developer: -02:message/developer[3]: +02:message/developer[2]: [01] [02] - [03] 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__strict_3p_cache__strict_3p_mcp_catalog_cache.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__strict_3p_cache__strict_3p_mcp_catalog_cache.snap index 65f3664391..3f64b62f85 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__strict_3p_cache__strict_3p_mcp_catalog_cache.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__strict_3p_cache__strict_3p_mcp_catalog_cache.snap @@ -33,9 +33,8 @@ Settings: - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__unavailable_images_are_rechecked_without_rewriting_history.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__unavailable_images_are_rechecked_without_rewriting_history.snap index 28198e58fc..1fa4448d10 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__unavailable_images_are_rechecked_without_rewriting_history.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__unavailable_images_are_rechecked_without_rewriting_history.snap @@ -23,9 +23,8 @@ Scenario: Available file references pass through. A later request replaces missi - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: @@ -59,9 +58,8 @@ Scenario: Available file references pass through. A later request replaces missi - function/wait_agent 01:message/developer: -02:message/developer[2]: - [01] - [02] +02:message/developer: + 03:message/developer: 04:message/developer: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_local.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_local.snap index 7be7c5dd27..2261c45a32 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_local.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_local.snap @@ -51,27 +51,11 @@ Settings: 02:message/developer: scenario_prefix: A -03:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +03:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 04:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -171,27 +155,11 @@ Settings: unavailable (items only) Plan the release. 04:message/user: Check the plan. -05:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +05:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 06:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -268,27 +236,11 @@ Settings: same as window 1 Plan the release. 04:message/user: Check the plan. -05:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +05:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 06:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_remote.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_remote.snap index bfef2ba025..6ffdb6195c 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_remote.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__world_state_prefix__extension_window_prefix_remote.snap @@ -51,27 +51,11 @@ Settings: 02:message/developer: scenario_prefix: A -03:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +03:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 04:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -162,27 +146,11 @@ Settings: unavailable (items only) Plan the release. 04:message/user: Check the plan. -05:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +05:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 06:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. @@ -257,27 +225,11 @@ Settings: same as window 1 Plan the release. 04:message/user: Check the plan. -05:message/developer[2]: - [01] - Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] - Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. - - [02] # Collaboration Mode: Default - - You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. - - Your active mode changes only when new developer instructions with a different `...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812] - - ## request_user_input availability - - Use the `request_user_input` tool only when it is listed in the available tools for this turn. - - Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work. - - If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked. - - Never use the `request_user_input` tool for permission requests or permission-related escalations. - +05:message/developer: + + Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b] + Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected. + 06:message/developer: You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. diff --git a/codex-rs/core/tests/suite/step_settings.rs b/codex-rs/core/tests/suite/step_settings.rs index 3abced94da..fe105f4697 100644 --- a/codex-rs/core/tests/suite/step_settings.rs +++ b/codex-rs/core/tests/suite/step_settings.rs @@ -1087,8 +1087,8 @@ async fn active_model_switch_updates_core_context_from_captured_settings( let messages = model.model_messages.as_mut().expect("model messages"); messages.instructions_template = Some(format!("Instructions for {slug}.")); messages.collaboration_modes = Some(CollaborationModeMessages { - default: Some(format!("Default collaboration for {slug}.")), - plan: None, + default: None, + plan: Some(format!("Plan collaboration for {slug}.")), }); messages.multi_agent = Some(MultiAgentMessages { role: Some(MultiAgentRoleMessages { @@ -1129,6 +1129,14 @@ async fn active_model_switch_updates_core_context_from_captured_settings( }) .build_with_auto_env(&server) .await?; + let mut collaboration_mode = test.codex.config_snapshot().await.collaboration_mode; + collaboration_mode.mode = codex_protocol::config_types::ModeKind::Plan; + test.codex + .update_thread_settings(ThreadSettingsOverrides { + collaboration_mode: Some(collaboration_mode), + ..Default::default() + }) + .await?; let request = start_paused_turn(&test.codex).await?; if reload_user_config { @@ -1205,7 +1213,7 @@ async fn active_model_switch_updates_core_context_from_captured_settings( "model-switch instructions should not contain a personality update" ); for text in [ - format!("Default collaboration for {MODEL_B}."), + format!("Plan collaboration for {MODEL_B}."), format!("Approval instructions for {MODEL_B}."), format!("Root role for {MODEL_B}."), format!("Delegation policy for {MODEL_B}."), diff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__safety_buffering__safety_recourse_request_history.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__safety_buffering__safety_recourse_request_history.snap index 449519422b..82d3c02a3b 100644 --- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__safety_buffering__safety_recourse_request_history.snap +++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__safety_buffering__safety_recourse_request_history.snap @@ -1,6 +1,5 @@ --- source: tui/src/app/tests/safety_buffering.rs -assertion_line: 284 expression: "context_snapshot::format_request_history_snapshot(\"The fork excludes the blocked turn and submits the selected rewrite.\",\n&requests, &ContextSnapshotOptions::default().rewrite_known_segments(),)" --- Scenario: The fork excludes the blocked turn and submits the selected rewrite. @@ -9,11 +8,10 @@ Scenario: The fork excludes the blocked turn and submits the selected rewrite. -- request 1 (turn) -- 00:message/developer: Help the user. -01:message/developer[4]: +01:message/developer[3]: [01] [02] - [03] - [04] + [03] Deferred tool namespaces: - codex_tui: Manage Codex tasks available through the connected app server. @@ -26,11 +24,10 @@ Scenario: The fork excludes the blocked turn and submits the selected rewrite. -- request 2 (turn) -- 00:message/developer: Help the user. -01:message/developer[4]: +01:message/developer[3]: [01] [02] - [03] - [04] + [03] Deferred tool namespaces: - codex_tui: Manage Codex tasks available through the connected app server. diff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__session_lifecycle_requests__new_session_tests__clear_context_plan_request.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__session_lifecycle_requests__new_session_tests__clear_context_plan_request.snap index 369b57dd79..178aff0b04 100644 --- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__session_lifecycle_requests__new_session_tests__clear_context_plan_request.snap +++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__session_lifecycle_requests__new_session_tests__clear_context_plan_request.snap @@ -8,11 +8,10 @@ Scenario: Clear context and implement the approved plan in a fresh thread. -- request 1 (request) -- 00:message/developer: Help the user. -01:message/developer[4]: +01:message/developer[3]: [01] [02] - [03] - [04] + [03] Deferred tool namespaces: - codex_tui: Manage Codex tasks available through the connected app server.