From 94e7d86df19005d03a58c701ab395f38970f4fb5 Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Wed, 15 Apr 2026 02:22:50 +0800 Subject: [PATCH] fix: stop forwarding strict mode to Bedrock Converse API Forwarding strict and sanitizing tool schemas for strict mode causes Bedrock Converse requests to hang until timeout. Drop strict forwarding and schema sanitization from the Bedrock provider. --- .../llms/providers/bedrock/completion.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py index 5932b66f0..54c222c85 100644 --- a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py +++ b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py @@ -17,10 +17,7 @@ from crewai.utilities.agent_utils import is_context_length_exceeded from crewai.utilities.exceptions.context_window_exceeding_exception import ( LLMContextLengthExceededError, ) -from crewai.utilities.pydantic_schema_utils import ( - generate_model_description, - sanitize_tool_params_for_bedrock_strict, -) +from crewai.utilities.pydantic_schema_utils import generate_model_description from crewai.utilities.types import LLMMessage @@ -173,7 +170,6 @@ class ToolSpec(TypedDict, total=False): name: Required[str] description: Required[str] inputSchema: ToolInputSchema - strict: bool class ConverseToolTypeDef(TypedDict): @@ -1988,21 +1984,10 @@ class BedrockCompletion(BaseLLM): "description": description, } - func_info = tool.get("function", {}) - strict_enabled = bool(func_info.get("strict")) - if parameters and isinstance(parameters, dict): - schema_params = ( - sanitize_tool_params_for_bedrock_strict(parameters) - if strict_enabled - else parameters - ) - input_schema: ToolInputSchema = {"json": schema_params} + input_schema: ToolInputSchema = {"json": parameters} tool_spec["inputSchema"] = input_schema - if strict_enabled: - tool_spec["strict"] = True - converse_tool: ConverseToolTypeDef = {"toolSpec": tool_spec} converse_tools.append(converse_tool)