From c9bea3f13e09c782a97196ae356fda67827da9d0 Mon Sep 17 00:00:00 2001 From: Toshal Kumbhar Date: Sat, 4 Jul 2026 05:33:12 +0530 Subject: [PATCH 1/2] fix(core): ensure tool_choice maps to structured object for AWS Bedrock compliance --- strix/core/execution.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/strix/core/execution.py b/strix/core/execution.py index 06dc3ddf5..f252e3008 100644 --- a/strix/core/execution.py +++ b/strix/core/execution.py @@ -349,6 +349,15 @@ async def _run_cycle( # noqa: PLR0912, PLR0915 while True: try: await coordinator.mark_running(agent_id) + + # --- PRODUCTION FIX FOR AWS BEDROCK TOOL_CHOICE COMPLIANCE --- + if hasattr(run_config, "extra_body") and isinstance(run_config.extra_body, dict): + if "tool_choice" in run_config.extra_body: + run_config.extra_body["tool_choice"] = {"type": "auto"} + elif hasattr(run_config, "tool_choice") and (run_config.tool_choice == "auto" or isinstance(run_config.tool_choice, str)): + run_config.tool_choice = {"type": "auto"} + # ------------------------------------------------------------- + stream = Runner.run_streamed( agent, input=input_data, From 4634ae6ea89221913936512c5215e9ba64202f59 Mon Sep 17 00:00:00 2001 From: Toshal Kumbhar Date: Sat, 4 Jul 2026 15:05:46 +0530 Subject: [PATCH 2/2] Update strix/core/execution.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- strix/core/execution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strix/core/execution.py b/strix/core/execution.py index f252e3008..4b50dec19 100644 --- a/strix/core/execution.py +++ b/strix/core/execution.py @@ -354,7 +354,7 @@ async def _run_cycle( # noqa: PLR0912, PLR0915 if hasattr(run_config, "extra_body") and isinstance(run_config.extra_body, dict): if "tool_choice" in run_config.extra_body: run_config.extra_body["tool_choice"] = {"type": "auto"} - elif hasattr(run_config, "tool_choice") and (run_config.tool_choice == "auto" or isinstance(run_config.tool_choice, str)): + if hasattr(run_config, "tool_choice") and (run_config.tool_choice == "auto" or isinstance(run_config.tool_choice, str)): run_config.tool_choice = {"type": "auto"} # -------------------------------------------------------------