mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 23:47:54 +08:00
core/agent: tell the compact summarizer that tools are unavailable
This commit is contained in:
@@ -30,6 +30,8 @@ _SUMMARY_SYSTEM = (
|
|||||||
"Write a dense, factual summary that preserves: goals, decisions, "
|
"Write a dense, factual summary that preserves: goals, decisions, "
|
||||||
"file paths touched, commands run, open tasks, and constraints. "
|
"file paths touched, commands run, open tasks, and constraints. "
|
||||||
"Omit chit-chat and redundant tool dumps. Use short bullet sections. "
|
"Omit chit-chat and redundant tool dumps. Use short bullet sections. "
|
||||||
|
"Tool calls are unavailable in this request: do not call tools or emit "
|
||||||
|
"tool-call syntax; summarize only what the transcript contains. "
|
||||||
"Do not invent facts not present in the transcript."
|
"Do not invent facts not present in the transcript."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,15 @@ async def test_summarize_messages() -> None:
|
|||||||
assert "world" in user_msg.content
|
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:
|
async def test_summarize_custom_prompts() -> None:
|
||||||
client = SummaryClient()
|
client = SummaryClient()
|
||||||
_ = await summarize_messages(
|
_ = await summarize_messages(
|
||||||
|
|||||||
Reference in New Issue
Block a user