From d8ccc0f051aa0c363578f11ea2c09c5d2507133e Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 2 Dec 2026 03:18:33 +0000 Subject: [PATCH] Enable Responses Lite for Amazon Bedrock Runtime profiles (#65185) ## What changed Set `use_responses_lite` for all `global.` and `us.` model profiles in the Bedrock Runtime catalog. ## Testing Update the catalog test to require Responses Lite for every Runtime profile. Update the request test to check that the selected model ID is preserved, the Responses Lite header is sent, and `additional_tools` declares `functions.exec` while omitting `web_search`. GitOrigin-RevId: 7bd3d793f6365d4bffdf51528eeb3dac0d441aba --- codex-rs/core/tests/suite/web_search.rs | 28 +++++++++++-------- .../src/amazon_bedrock/runtime_catalog.rs | 1 + .../amazon_bedrock/runtime_catalog_tests.rs | 4 +-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/codex-rs/core/tests/suite/web_search.rs b/codex-rs/core/tests/suite/web_search.rs index d648069705..c5f3956160 100644 --- a/codex-rs/core/tests/suite/web_search.rs +++ b/codex-rs/core/tests/suite/web_search.rs @@ -215,19 +215,25 @@ async fn amazon_bedrock_runtime_preserves_cross_region_models_without_web_search .await .expect("submit Bedrock Runtime turn"); - let body = response.single_request().body_json(); - let web_search_tool = body - .get("tools") - .and_then(Value::as_array) - .and_then(|tools| { - tools - .iter() - .find(|tool| tool.get("type").and_then(Value::as_str) == Some("web_search")) - }); + let request = response.single_request(); + assert_eq!(request.body_json()["model"], model); assert_eq!( - (body["model"].as_str(), web_search_tool), - (Some(model), None) + request + .header("x-openai-internal-codex-responses-lite") + .as_deref(), + Some("true") ); + let declarations = request.inputs_of_type("additional_tools"); + assert!( + declarations + .iter() + .any(|item| responses::namespace_child_tool(item, "functions", "exec").is_some()) + ); + assert!(!declarations.iter().any(|item| { + item["tools"] + .as_array() + .is_some_and(|tools| tools.iter().any(|tool| tool["type"] == "web_search")) + })); } } diff --git a/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog.rs b/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog.rs index a5113d4abc..ae70f38936 100644 --- a/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog.rs +++ b/codex-rs/model-provider/src/amazon_bedrock/runtime_catalog.rs @@ -44,6 +44,7 @@ pub(super) fn static_runtime_model_catalog() -> ModelsResponse { variant.slug = format!("{prefix}{}", model.slug); variant.display_name = format!("{} ({routing_label})", model.display_name); variant.priority = routing_priority * base_models.len() as i32 + model.priority; + variant.use_responses_lite = true; models.push(variant); } } 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 5f4bfb819b..6bc48f8a7b 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 @@ -59,7 +59,7 @@ fn runtime_catalog_includes_supported_cross_region_models_in_priority_order() { } #[test] -fn runtime_profiles_inherit_model_capabilities() { +fn runtime_profiles_inherit_model_capabilities_and_enable_lite() { let base = static_model_catalog(); for profile in static_runtime_model_catalog().models { let (_, slug) = profile.slug.split_once('.').expect("routing prefix"); @@ -81,7 +81,7 @@ fn runtime_profiles_inherit_model_capabilities() { model.multi_agent_version, None, model.tool_mode, - model.use_responses_lite, + true, ), "{}", profile.slug