core/agent: tell the compact summarizer that tools are unavailable

This commit is contained in:
2026-10-17 17:13:42 +08:00
parent eef1d3cd29
commit f5cff9d90d
2 changed files with 11 additions and 0 deletions
@@ -130,6 +130,15 @@ async def test_summarize_messages() -> None:
assert "world" in user_msg.content
async def test_summarize_default_prompt_says_tools_are_unavailable() -> None:
client = SummaryClient()
_ = await summarize_messages(client, [UserChatMessage(content="hi")], model="m")
assert client.last is not None
sys_msg = client.last.messages[0]
assert isinstance(sys_msg, SystemChatMessage)
assert "tool calls are unavailable" in sys_msg.content.lower()
async def test_summarize_custom_prompts() -> None:
client = SummaryClient()
_ = await summarize_messages(