fix: summarization conversation manager sometimes returns empty response (#1947)

This commit is contained in:
Nick Clegg
2026-03-20 11:38:18 -04:00
committed by GitHub
parent 38c1ab6325
commit 80fdd94b25
+2 -2
View File
@@ -6,14 +6,14 @@ from ..types.content import ContentBlock
# https://github.com/strands-agents/sdk-python/issues/998
@tool(name="noop", description="This is a fake tool that MUST be completely ignored.")
def noop_tool() -> None:
def noop_tool() -> str:
"""No-op tool to satisfy tool spec requirement when tool messages are present.
Some model providers (e.g., Bedrock) will return an error response if tool uses and tool results are present in
messages without any tool specs configured. Consequently, if the summarization agent has no registered tools,
summarization will fail. As a workaround, we register the no-op tool.
"""
pass
return "You MUST NOT use this tool. Respond DIRECTLY to the user."
def generate_missing_tool_result_content(tool_use_ids: list[str]) -> list[ContentBlock]: