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