From 2b5111917c1497ed945da543221f67ebe6e95280 Mon Sep 17 00:00:00 2001 From: rhan-oai Date: Fri, 20 Nov 2026 21:20:02 +0000 Subject: [PATCH] Tag all multi-agent role instructions consistently (#62842) ## Why Only catalog role instructions carried the `` tag, so the same guidance appeared in different formats depending on its source. ## What changed Render bundled, catalog, and configured root and subagent guidance as `multi_agent.role_instructions` developer messages. Wrap the guidance in `` tags and preserve configured text that's already tagged. Match untagged parent guidance by its body when filtering forked history. ## Testing Update prompt and session assertions for tagged role instructions, and keep the cold-resume test exercising a rollout with legacy untagged guidance. GitOrigin-RevId: 60c55b5d7227811b92bd1bf125f1cd3a965720fd --- codex-rs/core/src/agent/control_tests.rs | 5 +- codex-rs/core/src/agent/history.rs | 2 +- .../src/context/multi_agent_usage_hint.rs | 2 +- .../world_state/multi_agent_mode_tests.rs | 1 - .../world_state/multi_agent_usage_hint.rs | 16 +---- codex-rs/core/src/session/multi_agents.rs | 1 - codex-rs/core/src/session/tests.rs | 65 +++++------------ .../core/tests/suite/context_annotations.rs | 2 +- codex-rs/core/tests/suite/scenarios.rs | 4 +- ...mpaction_cold_resume_after_completion.snap | 54 +------------- ...gent_eviction__idle_eviction_followup.snap | 36 +--------- ...ge_board__agent_message_board_context.snap | 18 +---- ...http__agent_message_board_mcp_context.snap | 36 +--------- ...ent_message_board_mcp_feature_context.snap | 36 +--------- ...p__agent_message_board_plugin_context.snap | 36 +--------- ...age_board__remote__remote_board_tools.snap | 18 +---- ...ompaction_preserves_summary_on_resume.snap | 54 +------------- ...ypted_native_history_custom_namespace.snap | 72 ++----------------- ...pted_native_history_default_namespace.snap | 72 ++----------------- ...survives_incremental_guardian_reviews.snap | 54 +------------- ...enarios__guardian_code_mode_messaging.snap | 54 +------------- ...__catalog_indirect_namespace_prefixes.snap | 4 +- ..._partial_answers__partial_answer_fork.snap | 18 +---- ...artial_answers__preserved_answer_fork.snap | 6 +- ...ilities__custom_provider_capabilities.snap | 18 +---- ...sage__agent_followup_AfterFinalAnswer.snap | 18 +---- ...age__agent_followup_BeforeFinalAnswer.snap | 18 +---- .../tests/suite/spawn_agent_description.rs | 6 +- .../prompts/src/multi_agent_instructions.rs | 8 +-- .../src/multi_agent_instructions_tests.rs | 43 +++++------ 30 files changed, 91 insertions(+), 686 deletions(-) diff --git a/codex-rs/core/src/agent/control_tests.rs b/codex-rs/core/src/agent/control_tests.rs index 8b41481aa0..1a3395e3a1 100644 --- a/codex-rs/core/src/agent/control_tests.rs +++ b/codex-rs/core/src/agent/control_tests.rs @@ -3285,10 +3285,8 @@ async fn spawn_agent_can_fork_parent_thread_history_with_sanitized_items() { .expect("parent shutdown should submit"); } -#[test_case::test_case(true; "marked catalog hints")] -#[test_case::test_case(false; "unmarked bundled hints")] #[tokio::test] -async fn spawn_agent_fork_strips_parent_usage_hints_from_compacted_history(marked: bool) { +async fn spawn_agent_fork_strips_parent_usage_hints_from_compacted_history() { let harness = AgentControlHarness::new().await; let mut parent_config = harness.config.clone(); let _ = parent_config.features.enable(Feature::MultiAgentV2); @@ -3318,7 +3316,6 @@ async fn spawn_agent_fork_strips_parent_usage_hints_from_compacted_history(marke let parent_spawn_call_id = "spawn-call-compacted-usage-hints".to_string(); let catalog_role = |base: &str| MultiAgentRoleInstructions::Composed { base: base.to_string(), - marked, omit_update_plan_instructions: false, max_concurrency: 2, wait_agent_enabled: false, diff --git a/codex-rs/core/src/agent/history.rs b/codex-rs/core/src/agent/history.rs index d6e96794da..9fd043a07f 100644 --- a/codex-rs/core/src/agent/history.rs +++ b/codex-rs/core/src/agent/history.rs @@ -424,7 +424,7 @@ pub(super) async fn prepare_forked_history( [parent_usage_hints.root, parent_usage_hints.subagent] .into_iter() .flatten() - .map(|instructions| instructions.render().into_text().unwrap_or_default()) + .map(|instructions| instructions.body().into_text().unwrap_or_default()) .collect() } else { Vec::new() diff --git a/codex-rs/core/src/context/multi_agent_usage_hint.rs b/codex-rs/core/src/context/multi_agent_usage_hint.rs index 931268aede..7fc670ffc4 100644 --- a/codex-rs/core/src/context/multi_agent_usage_hint.rs +++ b/codex-rs/core/src/context/multi_agent_usage_hint.rs @@ -3,7 +3,7 @@ use codex_protocol::models::ContentItem; use codex_protocol::models::ContentItemKind; use codex_protocol::models::input_text; -/// Configured multi-agent instructions emitted as a standalone developer message. +/// Developer note introducing a child after its inherited conversation prefix. #[derive(Clone, Debug, PartialEq, Eq)] pub(crate) struct MultiAgentUsageHint { text: String, diff --git a/codex-rs/core/src/context/world_state/multi_agent_mode_tests.rs b/codex-rs/core/src/context/world_state/multi_agent_mode_tests.rs index c230904df1..4d20a4a098 100644 --- a/codex-rs/core/src/context/world_state/multi_agent_mode_tests.rs +++ b/codex-rs/core/src/context/world_state/multi_agent_mode_tests.rs @@ -102,7 +102,6 @@ fn unchanged_mode_is_reemitted_after_usage_hint_migration() { fn catalog_role_updates_remain_separate_from_active_mode() { let catalog_role = |base: &str| MultiAgentRoleInstructions::Composed { base: base.to_string(), - marked: true, omit_update_plan_instructions: false, max_concurrency: 2, wait_agent_enabled: false, diff --git a/codex-rs/core/src/context/world_state/multi_agent_usage_hint.rs b/codex-rs/core/src/context/world_state/multi_agent_usage_hint.rs index 57d7dadf83..ac41464fa7 100644 --- a/codex-rs/core/src/context/world_state/multi_agent_usage_hint.rs +++ b/codex-rs/core/src/context/world_state/multi_agent_usage_hint.rs @@ -5,7 +5,6 @@ use super::WorldStateSection; use super::WorldStateUpdate; use crate::context::ContextualUserFragment; use crate::context::MultiAgentRoleInstructions; -use crate::context::MultiAgentUsageHint; use codex_protocol::models::ContentItemMetadata; use codex_protocol::models::ContentItemNamespace; @@ -52,18 +51,9 @@ impl WorldStateSection for MultiAgentUsageHintState { } PreviousSectionState::Unknown => None, PreviousSectionState::Known(_) | PreviousSectionState::Absent => { - if self.instructions.markers().0.is_empty() { - Some(Box::new( - MultiAgentUsageHint::new( - &self.instructions.body().into_text().unwrap_or_default(), - ) - .with_metadata(ContentItemMetadata::tool(self.namespace.clone())), - )) - } else { - Some(Box::new(self.instructions.clone().with_metadata( - ContentItemMetadata::tool(self.namespace.clone()), - ))) - } + Some(Box::new(self.instructions.clone().with_metadata( + ContentItemMetadata::tool(self.namespace.clone()), + ))) } }; ( diff --git a/codex-rs/core/src/session/multi_agents.rs b/codex-rs/core/src/session/multi_agents.rs index 3b24a9c34f..29c9fcd1c2 100644 --- a/codex-rs/core/src/session/multi_agents.rs +++ b/codex-rs/core/src/session/multi_agents.rs @@ -59,7 +59,6 @@ pub(crate) fn resolve_usage_hints( } Some(MultiAgentRoleInstructions::Composed { base: base.to_owned(), - marked: message.catalog_override().is_some(), omit_update_plan_instructions, max_concurrency: config.max_concurrent_threads_per_session, wait_agent_enabled: config.wait_agent_enabled, diff --git a/codex-rs/core/src/session/tests.rs b/codex-rs/core/src/session/tests.rs index ec508e97df..f73a245cb1 100644 --- a/codex-rs/core/src/session/tests.rs +++ b/codex-rs/core/src/session/tests.rs @@ -10854,6 +10854,17 @@ async fn build_initial_context_omits_prompt_fragments_without_extension_state() ); } +fn multi_agent_role_messages(items: &[ResponseItem]) -> Vec> { + developer_message_texts(items) + .into_iter() + .filter(|message| { + message + .iter() + .any(|text| MultiAgentRoleInstructions::matches_text(text)) + }) + .collect() +} + #[tokio::test] async fn build_initial_context_adds_multi_agent_v2_root_usage_hint_as_developer_message() { let (session, turn_context) = @@ -10861,18 +10872,9 @@ async fn build_initial_context_adds_multi_agent_v2_root_usage_hint_as_developer_ let initial_context = build_initial_context(&session, &turn_context).await; - let developer_messages = developer_message_texts(&initial_context); - assert!( - developer_messages - .iter() - .any(|message| message.as_slice() == ["Root guidance."]), - "expected standalone root usage hint developer message, got {developer_messages:?}" - ); - assert!( - !developer_messages - .iter() - .any(|message| message.as_slice() == ["Subagent guidance."]), - "did not expect subagent usage hint for root thread, got {developer_messages:?}" + assert_eq!( + multi_agent_role_messages(&initial_context), + [["Root guidance."]] ); } @@ -10912,17 +10914,9 @@ async fn build_initial_context_adds_multi_agent_v2_subagent_usage_hint_as_develo .contains("\nAgent name: /root/worker\n")), "expected subagent context window to include its canonical name, got {developer_messages:?}" ); - assert!( - developer_messages - .iter() - .any(|message| message.as_slice() == ["Subagent guidance."]), - "expected standalone subagent usage hint developer message, got {developer_messages:?}" - ); - assert!( - !developer_messages - .iter() - .any(|message| message.as_slice() == ["Root guidance."]), - "did not expect root usage hint for subagent thread, got {developer_messages:?}" + assert_eq!( + multi_agent_role_messages(&initial_context), + [["Subagent guidance."]] ); } @@ -10933,16 +10927,7 @@ async fn build_initial_context_omits_multi_agent_v2_usage_hints_when_feature_dis let initial_context = build_initial_context(&session, &turn_context).await; - let developer_messages = developer_message_texts(&initial_context); - assert!( - !developer_messages.iter().any(|message| { - matches!( - message.as_slice(), - ["Root guidance."] | ["Subagent guidance."] - ) - }), - "did not expect multi-agent v2 usage hint developer messages, got {developer_messages:?}" - ); + assert!(multi_agent_role_messages(&initial_context).is_empty()); } #[tokio::test] @@ -10960,19 +10945,7 @@ async fn build_initial_context_omits_multi_agent_v2_usage_hints_when_hint_is_emp let initial_context = build_initial_context(&session, &turn_context).await; - let developer_messages = developer_message_texts(&initial_context); - assert!( - !developer_messages.iter().any(|message| { - matches!( - message.as_slice(), - ["Root guidance."] | ["Subagent guidance."] - ) || message.iter().any(|text| { - text.contains("You are `/root`, the primary agent") - || text.contains("You are an agent in a team of agents") - }) - }), - "did not expect multi-agent v2 usage hint developer messages, got {developer_messages:?}" - ); + assert!(multi_agent_role_messages(&initial_context).is_empty()); } #[tokio::test] diff --git a/codex-rs/core/tests/suite/context_annotations.rs b/codex-rs/core/tests/suite/context_annotations.rs index b5d780c56c..da21bed97c 100644 --- a/codex-rs/core/tests/suite/context_annotations.rs +++ b/codex-rs/core/tests/suite/context_annotations.rs @@ -211,7 +211,7 @@ async fn first_request_item_types_roles_and_content_annotations() -> Result<()> message developer ["guardian.approved_action"] message developer ["generic.developer_instructions","token_budget.context_window_guidance","permissions.instructions","environments.instructions"] message developer ["token_budget.context_window","token_budget.context_window","token_budget.context_window"] - message developer ["multi_agent.usage_hint"] + message developer ["multi_agent.role_instructions"] message developer ["multi_agent.mode_instructions"] message user ["environments.environment_context"] message developer ["additional_content.automation_info"] diff --git a/codex-rs/core/tests/suite/scenarios.rs b/codex-rs/core/tests/suite/scenarios.rs index fc957f5b61..5069942bf7 100644 --- a/codex-rs/core/tests/suite/scenarios.rs +++ b/codex-rs/core/tests/suite/scenarios.rs @@ -3491,8 +3491,8 @@ async fn subagent_waits_for_its_inherited_environment_configuration() -> Result< "", ), ( - r"(?ms)(^\d+:message/developer:\n You are (?:`/root`, the primary agent|an agent) in a team of agents[^\n]+)\n.*?(\n^\d+:message/developer:)", - "${1}\n ${2}", + r"(?s)([^\n]+)\n.*?[^\n]*", + "${1}\n ", ), ( r#"(environment_id"\s*:\s*"| [02] 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -42,23 +26,7 @@ Scenario: Real paginated mid-turn compaction and cold resume from the bounded su [01] [02] 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -76,23 +44,7 @@ Scenario: Real paginated mid-turn compaction and cold resume from the bounded su [01] [02] 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap index 7d74cb6e05..908919c255 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap @@ -23,23 +23,7 @@ Scenario: A parent with no configured environment delegates an API migration, qu 02:message/developer: 03:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 2 available concurrency slots, meaning that up to 2 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 04:message/developer: 05:message/user: @@ -82,23 +66,7 @@ Scenario: A parent with no configured environment delegates an API migration, qu 02:message/developer: 03:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 2 available concurrency slots, meaning that up to 2 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 04:message/developer: 05:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__agent_message_board_context.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__agent_message_board_context.snap index a6f3088191..3611058903 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__agent_message_board_context.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__agent_message_board_context.snap @@ -11,23 +11,7 @@ Scenario: An active agent describes a channel, lists it, posts a shared decision 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_context.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_context.snap index 0e7eea4d3a..f54c015d9f 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_context.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_context.snap @@ -15,23 +15,7 @@ Scenario: A child posts through the HTTP MCP executable; its restarted parent di - mcp__codex_message_board 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -61,23 +45,7 @@ Scenario: A child posts through the HTTP MCP executable; its restarted parent di - mcp__codex_message_board 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_feature_context.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_feature_context.snap index 932c573fd5..4a3d00d16a 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_feature_context.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_mcp_feature_context.snap @@ -15,23 +15,7 @@ Scenario: The config flag starts an in-memory MCP board shared by a parent and c - mcp__codex_message_board 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -61,23 +45,7 @@ Scenario: The config flag starts an in-memory MCP board shared by a parent and c - mcp__codex_message_board 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_plugin_context.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_plugin_context.snap index 0f9dfb708f..eda34f4c11 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_plugin_context.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__http__agent_message_board_plugin_context.snap @@ -16,23 +16,7 @@ Scenario: A child posts through the HTTP MCP executable; its restarted parent di - mcp__codex_message_board 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -63,23 +47,7 @@ Scenario: A child posts through the HTTP MCP executable; its restarted parent di - mcp__codex_message_board 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_tools.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_tools.snap index f9c80a8425..fdb5959202 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_tools.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_message_board__remote__remote_board_tools.snap @@ -17,23 +17,7 @@ Scenario: Remote board tools and active-turn notifications share the existing se 03:message/developer: 04:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 05:message/developer: 06:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__interrupt_during_remote_compaction_preserves_summary_on_resume.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__interrupt_during_remote_compaction_preserves_summary_on_resume.snap index b813e8d925..a0ddec5ca6 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__interrupt_during_remote_compaction_preserves_summary_on_resume.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__compaction__interrupt_during_remote_compaction_preserves_summary_on_resume.snap @@ -11,23 +11,7 @@ Scenario: A child interrupted during mid-turn and post-turn remote compaction ke 01:message/developer: 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -46,23 +30,7 @@ Scenario: A child interrupted during mid-turn and post-turn remote compaction ke 01:message/developer: 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -90,23 +58,7 @@ Scenario: A child interrupted during mid-turn and post-turn remote compaction ke 02:message/developer: 03:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 04:message/developer: 05:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_custom_namespace.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_custom_namespace.snap index ffc734a82a..0a0bf871c6 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_custom_namespace.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_custom_namespace.snap @@ -11,23 +11,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -45,23 +29,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -163,23 +131,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -328,23 +280,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_default_namespace.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_default_namespace.snap index ebcc7bb18d..cb5fcb61be 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_default_namespace.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_native_history_default_namespace.snap @@ -11,23 +11,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -45,23 +29,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -163,23 +131,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -328,23 +280,7 @@ Scenario: A historical MAv2 send_message call and an encrypted parent reply reac 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_parent_reply_survives_incremental_guardian_reviews.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_parent_reply_survives_incremental_guardian_reviews.snap index 3f57fb8c0f..6004e59510 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_parent_reply_survives_incremental_guardian_reviews.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_agent_messages__encrypted_parent_reply_survives_incremental_guardian_reviews.snap @@ -11,23 +11,7 @@ Scenario: An encrypted parent reply is delivered as a native agent message. Both 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -118,23 +102,7 @@ Scenario: An encrypted parent reply is delivered as a native agent message. Both 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -254,23 +222,7 @@ Scenario: An encrypted parent reply is delivered as a native agent message. Both 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_code_mode_messaging.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_code_mode_messaging.snap index 1374957d78..7709b8a69c 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_code_mode_messaging.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__guardian_code_mode_messaging.snap @@ -16,23 +16,7 @@ Scenario: A root uses Code Mode to send a confirmation and receives a real user - mcp__codex_apps__user_message: Tools for working with user_message. 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -64,23 +48,7 @@ Scenario: A root uses Code Mode to send a confirmation and receives a real user - mcp__codex_apps__user_message: Tools for working with user_message. 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: @@ -92,23 +60,7 @@ Scenario: A root uses Code Mode to send a confirmation and receives a real user 08:message/developer: You are now a newly spawned child agent. The preceding conversation is inherited parent context. Follow ...are not inherited. Report your result to your parent. [hash=0e586a5d405d39db] 09:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 10:message/developer: 11:agent_message diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__indirect_namespace_prefixes__catalog_indirect_namespace_prefixes.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__indirect_namespace_prefixes__catalog_indirect_namespace_prefixes.snap index b29e1fcb17..989a39912a 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__indirect_namespace_prefixes__catalog_indirect_namespace_prefixes.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__indirect_namespace_prefixes__catalog_indirect_namespace_prefixes.snap @@ -26,7 +26,7 @@ Settings: 01:message/developer: 02:message/developer: - Coordinate sub-agents. + 03:message/developer: 04:message/user: @@ -57,7 +57,7 @@ Settings: relative to window 1 01:message/developer: 02:message/developer: - Coordinate sub-agents. + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__partial_answer_fork.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__partial_answer_fork.snap index b18ebbfab3..c8568b7c32 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__partial_answer_fork.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__partial_answer_fork.snap @@ -21,23 +21,7 @@ Scenario: A forked worker receives both stable answer fragments, with their phas 06:message/user: Have a worker check both results. 07:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 08:message/developer: 09:agent_message diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__preserved_answer_fork.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__preserved_answer_fork.snap index ea8485113f..7ea0b7a34a 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__preserved_answer_fork.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__partial_answers__preserved_answer_fork.snap @@ -38,7 +38,7 @@ Scenario: A worker inherits the parent prefix, then receives its own window hint First context window id: Current context window id: 04:message/developer: - You are /root. Coordinate the investigation. + 05:message/developer: 06:message/user: @@ -92,7 +92,7 @@ Scenario: A worker inherits the parent prefix, then receives its own window hint First context window id: Current context window id: 04:message/developer: - You are /root. Coordinate the investigation. + 05:message/developer: 06:message/user: @@ -114,7 +114,7 @@ Scenario: A worker inherits the parent prefix, then receives its own window hint 15:message/developer: Check both results independently. 16:message/developer: - You are a worker. Report to your parent. + 17:function_call_output/agent.thread_hint:Agent name: /root/worker First context window id: Current context window id: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__provider_capabilities__custom_provider_capabilities.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__provider_capabilities__custom_provider_capabilities.snap index 6500de5fc4..a3a27e6f92 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__provider_capabilities__custom_provider_capabilities.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__provider_capabilities__custom_provider_capabilities.snap @@ -34,23 +34,7 @@ Settings: 01:message/developer: 02:message/developer: - You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals. - - At the start of your turn, you are the active agent. - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. - All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools. - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an...message to a running agent without triggering a turn. [hash=7d40ff8b58977202] - Child agents can also spawn their own sub-agents. - - All agents share the same directory. In detail: - - All agents have access to the same container and filesystem as you. - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_AfterFinalAnswer.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_AfterFinalAnswer.snap index 703a593bfd..abe5cdacdb 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_AfterFinalAnswer.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_AfterFinalAnswer.snap @@ -12,23 +12,7 @@ Scenario: Agent follow-ups interrupt at a reasoning boundary, preserve encrypted 01:message/developer: 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_BeforeFinalAnswer.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_BeforeFinalAnswer.snap index 703a593bfd..abe5cdacdb 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_BeforeFinalAnswer.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__turn_input_agent_message__agent_followup_BeforeFinalAnswer.snap @@ -12,23 +12,7 @@ Scenario: Agent follow-ups interrupt at a reasoning boundary, preserve encrypted 01:message/developer: 02:message/developer: - You are an agent in a team of agents collaborating to complete a task. - - You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All ag...nd capable, and have access to the same set of tools. [hash=876a93c54d3f61d6] - - You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task an... `send_message` to pass a message to a running agent. [hash=824c12425c7626dc] - Child agents can also spawn their own sub-agents. - - When you provide a response in the final channel, that content is immediately delivered back to your parent agent. - - - All agents use the same current working directory. - - As a result, edits made by one agent are immediately visible to all other agents. - - When calling `wait_agent`, prefer longer waits (minutes) to avoid busy polling. - - There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you. - - Full-history forks (`fork_turns` omitted or `"all"`) inherit the parent model and reasoning effort and d...uctions; when doing so, set `fork_turns` to `"none"`. [hash=18ccf7e93ecabab9] + 03:message/developer: 04:message/user: diff --git a/codex-rs/core/tests/suite/spawn_agent_description.rs b/codex-rs/core/tests/suite/spawn_agent_description.rs index cc57d81d6f..b2eeb5d50d 100644 --- a/codex-rs/core/tests/suite/spawn_agent_description.rs +++ b/codex-rs/core/tests/suite/spawn_agent_description.rs @@ -58,7 +58,7 @@ fn spawn_agent_exposes_agent_type(body: &Value, namespace: &str) -> bool { fn resolved_root_usage_hint(config: &Config, request: &ResponsesRequest) -> String { if let Some(configured) = config.multi_agent_v2.root_agent_usage_hint_text.as_deref() { - return configured.to_string(); + return format!("{configured}"); } request @@ -664,11 +664,12 @@ async fn multi_agent_v2_cold_resume_refreshes_legacy_usage_hints_once( initial.submit_turn("before upgrading").await?; let initial_request = initial_response.single_request(); + let tagged_legacy_hint = resolved_root_usage_hint(&initial.config, &initial_request); assert!( initial_request .message_input_text_groups("developer") .iter() - .any(|group| { group.len() == 1 && group[0] == legacy_root_agent_usage_hint_text }), + .any(|group| group.len() == 1 && group[0] == tagged_legacy_hint), "legacy usage hint should be its own developer message" ); assert!( @@ -690,6 +691,7 @@ async fn multi_agent_v2_cold_resume_refreshes_legacy_usage_hints_once( let mut removed_recorded_usage_hint = false; let mut removed_usage_hint_presence = false; let legacy_rollout = std::fs::read_to_string(&rollout_path)? + .replace(&tagged_legacy_hint, legacy_root_agent_usage_hint_text) .lines() .map(codex_rollout::parse_rollout_line) .collect::, _>>()? diff --git a/codex-rs/prompts/src/multi_agent_instructions.rs b/codex-rs/prompts/src/multi_agent_instructions.rs index fc865e54ef..bf28cce32a 100644 --- a/codex-rs/prompts/src/multi_agent_instructions.rs +++ b/codex-rs/prompts/src/multi_agent_instructions.rs @@ -21,12 +21,11 @@ All agents share the same directory. In detail: /// Multi-agent role text and the captured capabilities used to render its context segment. #[derive(Debug, Clone, PartialEq, Eq)] pub enum MultiAgentRoleInstructions { - /// Complete configured instructions, emitted verbatim without catalog markers. + /// Complete configured role body. Configured(String), /// Selected catalog or bundled text, composed with captured runtime guidance. Composed { base: String, - marked: bool, omit_update_plan_instructions: bool, max_concurrency: usize, wait_agent_enabled: bool, @@ -50,8 +49,8 @@ impl ContextualUserFragment for MultiAgentRoleInstructions { fn markers(&self) -> (&'static str, &'static str) { match self { - Self::Composed { marked: true, .. } => Self::type_markers(), - Self::Configured(_) | Self::Composed { marked: false, .. } => ("", ""), + Self::Configured(text) if Self::matches_text(text) => ("", ""), + Self::Configured(_) | Self::Composed { .. } => Self::type_markers(), } } @@ -68,7 +67,6 @@ impl ContextualUserFragment for MultiAgentRoleInstructions { max_concurrency, wait_agent_enabled, expose_model_overrides, - .. } => { let base = if *omit_update_plan_instructions { without_update_plan_instructions(base) diff --git a/codex-rs/prompts/src/multi_agent_instructions_tests.rs b/codex-rs/prompts/src/multi_agent_instructions_tests.rs index ba3078823c..5bf292ee73 100644 --- a/codex-rs/prompts/src/multi_agent_instructions_tests.rs +++ b/codex-rs/prompts/src/multi_agent_instructions_tests.rs @@ -14,31 +14,22 @@ fn role_segment_filters_base_and_appends_bundled_guidance() { let expected_body = format!( "Role.\n## Work\nContinue.\n{shared}\n{wait}\n\nThere are 2 available concurrency slots, meaning that up to 2 agents can be active at once, including you.\n\n{model_override}" ); - for marked in [false, true] { - let instructions = MultiAgentRoleInstructions::Composed { - base: "Role.\n## Plan tool\nOmit role checklist guidance.\n## Work\nContinue." - .to_string(), - marked, - omit_update_plan_instructions: true, - max_concurrency: 2, - wait_agent_enabled: true, - expose_model_overrides: true, - }; - let expected_text = if marked { - format!("{expected_body}") - } else { - expected_body.clone() - }; - assert_eq!( - instructions.render_fragment(), - RenderedFragment::new( - "developer", - AnnotatedContent::text( - expected_text, - ContentItemKind("multi_agent.role_instructions".to_string()), - ContentItemMetadata::harness(), - ), + let instructions = MultiAgentRoleInstructions::Composed { + base: "Role.\n## Plan tool\nOmit role checklist guidance.\n## Work\nContinue.".to_string(), + omit_update_plan_instructions: true, + max_concurrency: 2, + wait_agent_enabled: true, + expose_model_overrides: true, + }; + assert_eq!( + instructions.render_fragment(), + RenderedFragment::new( + "developer", + AnnotatedContent::text( + format!("{expected_body}"), + ContentItemKind("multi_agent.role_instructions".to_string()), + ContentItemMetadata::harness(), ), - ); - } + ), + ); }