mirror of
https://github.com/strands-agents/harness-sdk.git
synced 2026-10-02 02:44:48 +08:00
fix: summarization conversation manager sometimes returns empty response (#1947)
This commit is contained in:
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user