From 8d10d7d23c8378879d033c22cd7ce3ccf749cebb Mon Sep 17 00:00:00 2001 From: charlesgong-openai Date: Wed, 24 Jun 2026 11:14:33 -0700 Subject: [PATCH] codex: fix CI failure on PR #28845 --- codex-rs/core-plugins/src/loader_tests.rs | 3 ++- codex-rs/core-plugins/src/manager_tests.rs | 1 + codex-rs/core-plugins/src/manifest.rs | 1 + codex-rs/core-plugins/src/marketplace.rs | 1 + codex-rs/core/tests/suite/plugins.rs | 28 ++++++++++++++++++---- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/codex-rs/core-plugins/src/loader_tests.rs b/codex-rs/core-plugins/src/loader_tests.rs index 3da97b012e..ed243d4409 100644 --- a/codex-rs/core-plugins/src/loader_tests.rs +++ b/codex-rs/core-plugins/src/loader_tests.rs @@ -114,8 +114,9 @@ enabled = true &stack, HashMap::new(), &store, + /*plugin_skill_snapshots*/ None, Some(Product::Codex), - /*prefer_remote_curated_conflicts*/ false, + /*remote_global_catalog_active*/ false, ) .await; diff --git a/codex-rs/core-plugins/src/manager_tests.rs b/codex-rs/core-plugins/src/manager_tests.rs index ed70e8b6d5..cdd948397a 100644 --- a/codex-rs/core-plugins/src/manager_tests.rs +++ b/codex-rs/core-plugins/src/manager_tests.rs @@ -1908,6 +1908,7 @@ async fn load_plugin_skills_dedupes_overlapping_manifest_roots() { description: None, keywords: Vec::new(), paths: crate::manifest::PluginManifestPaths { + agents: Vec::new(), skills: vec![ plugin_root.join("skills"), plugin_root.join("skills/abc"), diff --git a/codex-rs/core-plugins/src/manifest.rs b/codex-rs/core-plugins/src/manifest.rs index ebd0b7a0b7..bf62f35e36 100644 --- a/codex-rs/core-plugins/src/manifest.rs +++ b/codex-rs/core-plugins/src/manifest.rs @@ -858,6 +858,7 @@ mod tests { description: None, keywords: Vec::new(), paths: PluginManifestPaths { + agents: Vec::new(), skills: vec![plugin_root.join("skills").expect("skills URI")], mcp_servers: Some(PluginManifestMcpServers::Path( plugin_root.join(".mcp.json").expect("MCP URI"), diff --git a/codex-rs/core-plugins/src/marketplace.rs b/codex-rs/core-plugins/src/marketplace.rs index 6475d37876..01584bce10 100644 --- a/codex-rs/core-plugins/src/marketplace.rs +++ b/codex-rs/core-plugins/src/marketplace.rs @@ -96,6 +96,7 @@ impl MarketplacePluginManifestFallback { ) .ok()?; manifest.paths = crate::manifest::PluginManifestPaths { + agents: Vec::new(), skills: Vec::new(), mcp_servers: None, apps: None, diff --git a/codex-rs/core/tests/suite/plugins.rs b/codex-rs/core/tests/suite/plugins.rs index c6afd11567..de49e557ce 100644 --- a/codex-rs/core/tests/suite/plugins.rs +++ b/codex-rs/core/tests/suite/plugins.rs @@ -40,6 +40,7 @@ const SAMPLE_PLUGIN_APP_NAMESPACE: &str = "mcp__codex_apps__google_calendar"; const SAMPLE_PLUGIN_MCP_NAMESPACE: &str = "mcp__sample"; const PLUGIN_APP_SEARCH_CALL_ID: &str = "plugin-app-search"; const PLUGIN_MCP_SEARCH_CALL_ID: &str = "plugin-mcp-search"; +const PLUGIN_AGENT_SEARCH_CALL_ID: &str = "plugin-agent-search"; const MULTI_AGENT_V1_NAMESPACE: &str = "multi_agent_v1"; const SPAWN_AGENT_TOOL_NAME: &str = "spawn_agent"; @@ -317,9 +318,19 @@ async fn capability_sections_render_in_developer_message_in_order() -> Result<() async fn plugin_agent_roles_are_available_to_spawn_agent() -> Result<()> { skip_if_no_network!(Ok(())); let server = start_mock_server().await; - let resp_mock = mount_sse_once( + let resp_mock = mount_sse_sequence( &server, - sse(vec![ev_response_created("resp1"), ev_completed("resp1")]), + vec![ + sse(vec![ + ev_response_created("resp1"), + ev_tool_search_call( + PLUGIN_AGENT_SEARCH_CALL_ID, + &serde_json::json!({"query": "spawn agent"}), + ), + ev_completed("resp1"), + ]), + sse(vec![ev_response_created("resp2"), ev_completed("resp2")]), + ], ) .await; @@ -337,9 +348,16 @@ async fn plugin_agent_roles_are_available_to_spawn_agent() -> Result<()> { test_codex.submit_turn("hello").await?; - let body = resp_mock.single_request().body_json(); - let spawn_agent = namespace_child_tool(&body, MULTI_AGENT_V1_NAMESPACE, SPAWN_AGENT_TOOL_NAME) - .expect("spawn_agent should be available"); + let request = resp_mock + .last_request() + .expect("tool search follow-up request"); + let tool_search_output = request.tool_search_output(PLUGIN_AGENT_SEARCH_CALL_ID); + let spawn_agent = namespace_child_tool( + &tool_search_output, + MULTI_AGENT_V1_NAMESPACE, + SPAWN_AGENT_TOOL_NAME, + ) + .expect("spawn_agent should be available"); let agent_type_description = tool_parameter_description(spawn_agent, "agent_type") .expect("spawn_agent agent_type description"); assert!(