From 86ba987b544c316f2741e67abb7cb8204ef83837 Mon Sep 17 00:00:00 2001 From: Celia Chen Date: Thu, 20 Aug 2026 21:53:43 +0000 Subject: [PATCH] Use multi-agent V1 for Amazon Bedrock models (#39804) ## Why Amazon Bedrock does not support the response items required by multi-agent V2. ## What changed - Normalize Bedrock model catalogs to advertise `MultiAgentVersion::V1`. - Cover both remote catalog normalization and the static Bedrock Runtime catalog in tests. GitOrigin-RevId: 93832cd4b885daf4b87fb33a7be8502ae15c1b24 --- .../src/amazon_bedrock/catalog.rs | 5 +++ .../amazon_bedrock/runtime_catalog_tests.rs | 44 ++++++++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/codex-rs/model-provider/src/amazon_bedrock/catalog.rs b/codex-rs/model-provider/src/amazon_bedrock/catalog.rs index fb33161b1f..9230f31611 100644 --- a/codex-rs/model-provider/src/amazon_bedrock/catalog.rs +++ b/codex-rs/model-provider/src/amazon_bedrock/catalog.rs @@ -9,6 +9,7 @@ use codex_protocol::openai_models::ModelVisibility; use codex_protocol::openai_models::ModelsResponse; use codex_protocol::openai_models::ReasoningEffort; use codex_protocol::openai_models::WebSearchToolType; +use codex_protocol::protocol::MultiAgentVersion; const GPT_5_BEDROCK_CONTEXT_WINDOW: i64 = 272_000; const GPT_5_6_SOL_OPENAI_MODEL_ID: &str = "gpt-5.6-sol"; @@ -62,6 +63,8 @@ pub(crate) fn normalize_bedrock_catalog(mut catalog: ModelsResponse) -> ModelsRe model.default_service_tier = None; // Bedrock rejects the `search_content_types` field used by multimodal search. model.web_search_tool_type = WebSearchToolType::Text; + // Bedrock does not support the response items used by multi-agent V2. + model.multi_agent_version = Some(MultiAgentVersion::V1); } catalog } @@ -199,6 +202,7 @@ mod tests { expected.service_tiers.clear(); expected.default_service_tier = None; expected.web_search_tool_type = WebSearchToolType::Text; + expected.multi_agent_version = Some(MultiAgentVersion::V1); assert_eq!( normalize_bedrock_catalog(ModelsResponse { @@ -268,6 +272,7 @@ mod tests { expected.service_tiers.clear(); expected.default_service_tier = None; expected.web_search_tool_type = WebSearchToolType::Text; + expected.multi_agent_version = Some(MultiAgentVersion::V1); assert_eq!( catalog.models.iter().find(|model| model.slug == slug), diff --git a/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog_tests.rs b/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog_tests.rs index 5ed84edfec..81c3989904 100644 --- a/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog_tests.rs +++ b/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog_tests.rs @@ -1,3 +1,4 @@ +use codex_protocol::protocol::MultiAgentVersion; use pretty_assertions::assert_eq; use super::static_runtime_model_catalog; @@ -47,15 +48,46 @@ fn runtime_catalog_disables_web_search_without_overriding_review_models() { model.slug.as_str(), model.auto_review_model_override.as_deref(), model.supports_search_tool, + model.multi_agent_version, )) .collect::>(), vec![ - ("global.openai.gpt-5.6-sol", None, false), - ("global.openai.gpt-5.6-terra", None, false), - ("global.openai.gpt-5.6-luna", None, false), - ("us.openai.gpt-5.6-sol", None, false), - ("us.openai.gpt-5.6-terra", None, false), - ("us.openai.gpt-5.6-luna", None, false), + ( + "global.openai.gpt-5.6-sol", + None, + false, + Some(MultiAgentVersion::V1), + ), + ( + "global.openai.gpt-5.6-terra", + None, + false, + Some(MultiAgentVersion::V1), + ), + ( + "global.openai.gpt-5.6-luna", + None, + false, + Some(MultiAgentVersion::V1), + ), + ( + "us.openai.gpt-5.6-sol", + None, + false, + Some(MultiAgentVersion::V1), + ), + ( + "us.openai.gpt-5.6-terra", + None, + false, + Some(MultiAgentVersion::V1), + ), + ( + "us.openai.gpt-5.6-luna", + None, + false, + Some(MultiAgentVersion::V1), + ), ] ); }