From 284c03ceabe0fc52fdff8e24657d1fa4ddf5fcdb Mon Sep 17 00:00:00 2001 From: jif-oai Date: Mon, 9 Feb 2026 11:25:37 +0000 Subject: [PATCH] chore: enable sub agents (#11173) --- codex-rs/core/src/agent/role.rs | 1 - codex-rs/core/src/features.rs | 16 +++--- codex-rs/core/src/tools/spec.rs | 55 +++++++++++++++++++++ codex-rs/core/tests/suite/model_tools.rs | 32 +++++++++++- codex-rs/core/tests/suite/prompt_caching.rs | 5 ++ 5 files changed, 97 insertions(+), 12 deletions(-) diff --git a/codex-rs/core/src/agent/role.rs b/codex-rs/core/src/agent/role.rs index 74eca4179..234d67994 100644 --- a/codex-rs/core/src/agent/role.rs +++ b/codex-rs/core/src/agent/role.rs @@ -95,7 +95,6 @@ Rules: reasoning_effort: Some(ReasoningEffort::Medium), description: r#"Use `explorer` for all codebase questions. Explorers are fast and authoritative. -Always prefer them over manual search or file reading. Rules: - Ask explorers first and precisely. - Do not re-read or re-search code they cover. diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs index 7de37e78a..201430c9b 100644 --- a/codex-rs/core/src/features.rs +++ b/codex-rs/core/src/features.rs @@ -432,6 +432,12 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::Deprecated, default_enabled: false, }, + FeatureSpec { + id: Feature::Collab, + key: "collab", + stage: Stage::Stable, + default_enabled: true, + }, // Experimental program. Rendered in the `/experimental` menu for users. FeatureSpec { id: Feature::RuntimeMetrics, @@ -511,16 +517,6 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::Stable, default_enabled: true, }, - FeatureSpec { - id: Feature::Collab, - key: "collab", - stage: Stage::Experimental { - name: "Sub-agents", - menu_description: "Ask Codex to spawn multiple agents to parallelize the work and win in efficiency.", - announcement: "NEW: Sub-agents can now be spawned by Codex. Enable in /experimental and restart Codex!", - }, - default_enabled: false, - }, FeatureSpec { id: Feature::Apps, key: "apps", diff --git a/codex-rs/core/src/tools/spec.rs b/codex-rs/core/src/tools/spec.rs index 0c6c7c5e9..949a5f050 100644 --- a/codex-rs/core/src/tools/spec.rs +++ b/codex-rs/core/src/tools/spec.rs @@ -1666,6 +1666,11 @@ mod tests { external_web_access: Some(true), }, create_view_image_tool(), + create_spawn_agent_tool(), + create_send_input_tool(), + create_resume_agent_tool(), + create_wait_tool(), + create_close_agent_tool(), ] { expected.insert(tool_name(&spec).to_string(), spec); } @@ -1860,6 +1865,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1882,6 +1892,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1906,6 +1921,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1930,6 +1950,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1951,6 +1976,11 @@ mod tests { "request_user_input", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1973,6 +2003,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -1994,6 +2029,11 @@ mod tests { "request_user_input", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -2016,6 +2056,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -2062,6 +2107,11 @@ mod tests { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } @@ -2085,6 +2135,11 @@ mod tests { "request_user_input", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ); } diff --git a/codex-rs/core/tests/suite/model_tools.rs b/codex-rs/core/tests/suite/model_tools.rs index ae5914613..3143f5d49 100644 --- a/codex-rs/core/tests/suite/model_tools.rs +++ b/codex-rs/core/tests/suite/model_tools.rs @@ -81,6 +81,11 @@ async fn model_selects_expected_tools() { "request_user_input", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ), "codex-mini-latest should expose the local shell tool", @@ -100,6 +105,11 @@ async fn model_selects_expected_tools() { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ), "gpt-5-codex should expose the apply_patch tool", @@ -119,6 +129,11 @@ async fn model_selects_expected_tools() { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ), "gpt-5.1-codex should expose the apply_patch tool", @@ -137,6 +152,11 @@ async fn model_selects_expected_tools() { "request_user_input", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ), "gpt-5 should expose the apply_patch tool", @@ -156,6 +176,11 @@ async fn model_selects_expected_tools() { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ], ), "gpt-5.1 should expose the apply_patch tool", @@ -173,7 +198,12 @@ async fn model_selects_expected_tools() { "request_user_input".to_string(), "apply_patch".to_string(), "web_search".to_string(), - "view_image".to_string() + "view_image".to_string(), + "spawn_agent".to_string(), + "send_input".to_string(), + "resume_agent".to_string(), + "wait".to_string(), + "close_agent".to_string() ], "exp-5.1 should expose the apply_patch tool", ); diff --git a/codex-rs/core/tests/suite/prompt_caching.rs b/codex-rs/core/tests/suite/prompt_caching.rs index 242f93140..d1001c8df 100644 --- a/codex-rs/core/tests/suite/prompt_caching.rs +++ b/codex-rs/core/tests/suite/prompt_caching.rs @@ -153,6 +153,11 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { "apply_patch", "web_search", "view_image", + "spawn_agent", + "send_input", + "resume_agent", + "wait", + "close_agent", ]); let body0 = req1.single_request().body_json();