Skip to content

Commit 2794302

Browse files
Merge branch 'main' into supabase
2 parents 6938d6a + 940d470 commit 2794302

4 files changed

Lines changed: 30 additions & 6 deletions

File tree

integrations/amazon_bedrock/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [integrations/amazon_bedrock-v6.8.1] - 2026-04-22
4+
5+
### 🐛 Bug Fixes
6+
7+
- *(amazon-bedrock)* Prevent double-wrapping of tools_cachepoint_config in _format_tools (#3199)
8+
9+
### 🧪 Testing
10+
11+
- Bedrock - increase unit tests coverage (#3165)
12+
13+
314
## [integrations/amazon_bedrock-v6.8.0] - 2026-04-09
415

516
### 🚀 Features

integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _format_tools(
9393
)
9494

9595
if tools_cachepoint_config:
96-
tool_specs.append({"cachePoint": tools_cachepoint_config})
96+
tool_specs.append(tools_cachepoint_config)
9797

9898
return {"tools": tool_specs}
9999

integrations/amazon_bedrock/tests/test_chat_generator_utils.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def tools():
6767

6868
class TestAmazonBedrockChatGeneratorUtils:
6969
def test_format_tools(self, tools):
70-
formatted_tool = _format_tools(tools, tools_cachepoint_config={"type": "default"})
70+
formatted_tool = _format_tools(tools, tools_cachepoint_config={"cachePoint": {"type": "default"}})
7171
assert formatted_tool == {
7272
"tools": [
7373
{
@@ -103,6 +103,19 @@ def test_format_tools(self, tools):
103103
],
104104
}
105105

106+
def test_format_tools_does_not_double_wrap_cachepoint(self, tools):
107+
# Regression test for https://github.com/deepset-ai/haystack-core-integrations/issues/3181
108+
# __init__ pre-formats tools_cachepoint_config via _validate_and_format_cache_point,
109+
# so _format_tools must append it as-is without an extra cachePoint wrapper.
110+
111+
formatted_config = _validate_and_format_cache_point({"type": "default"})
112+
assert formatted_config == {"cachePoint": {"type": "default"}}
113+
114+
result = _format_tools(tools, tools_cachepoint_config=formatted_config)
115+
cache_entries = [e for e in result["tools"] if "cachePoint" in e]
116+
assert len(cache_entries) == 1
117+
assert cache_entries[0] == {"cachePoint": {"type": "default"}}
118+
106119
def test_convert_file_content_to_bedrock_format_no_mime_type(self):
107120
file_content = FileContent(
108121
base64_data=base64.b64encode(b"This is a test file content."),

integrations/mcp/tests/test_mcp_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def test_extract_first_text_element():
5959

6060

6161
def test_async_executor_run_raises_timeout_error():
62-
async def slow() -> None:
63-
await asyncio.sleep(0.05)
62+
async def never() -> None:
63+
await asyncio.Event().wait()
6464

6565
with pytest.raises(TimeoutError, match="timed out"):
66-
AsyncExecutor.get_instance().run(slow(), timeout=0.01)
66+
AsyncExecutor.get_instance().run(never(), timeout=0.01)
6767

6868

6969
class TestMCPTool:
@@ -468,7 +468,7 @@ async def test_mcp_tool_ainvoke_raises_timeout_error(self, mcp_tool_cleanup):
468468
mcp_tool_cleanup(tool)
469469

470470
async def hanging(*_args, **_kwargs):
471-
await asyncio.sleep(0.05)
471+
await asyncio.Event().wait()
472472

473473
tool._client.call_tool = hanging
474474
tool._invocation_timeout = 0.01

0 commit comments

Comments
 (0)