From 3a0c8e1597ac988a13fa04bf678e5e290253a3c3 Mon Sep 17 00:00:00 2001 From: Hare Date: Mon, 1 Jun 2026 07:50:27 +0900 Subject: [PATCH] memory: clean prompt helper warning --- crates/pod/src/prompt/system.rs | 25 ++----------------------- resources/prompts/common/tool-usage.md | 2 +- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/crates/pod/src/prompt/system.rs b/crates/pod/src/prompt/system.rs index a6f97ce0..336ddcd1 100644 --- a/crates/pod/src/prompt/system.rs +++ b/crates/pod/src/prompt/system.rs @@ -117,7 +117,7 @@ impl SystemPromptTemplate { let body = tmpl .render(ctx.to_minijinja_value()) .map_err(|e| SystemPromptError::Render(e.to_string()))?; - append_trailing_section_with_capabilities( + append_trailing_section( &body, ctx.prompts, ctx.scope, @@ -272,28 +272,7 @@ impl ToolCapabilities { /// comes from the prompt catalog (`PodPrompt::WorkingBoundariesSection` /// / `PodPrompt::AgentsMdSection`) so that wording can be overridden /// per-pack without touching this function. -pub fn append_trailing_section( - body: &str, - prompts: &PromptCatalog, - scope: &Scope, - agents_md: Option<&str>, - resident_summary: Option<&str>, - resident_knowledge: Option<&[ResidentKnowledgeEntry]>, - resident_workflows: Option<&[ResidentWorkflowEntry]>, -) -> Result { - append_trailing_section_with_capabilities( - body, - prompts, - scope, - agents_md, - resident_summary, - resident_knowledge, - resident_workflows, - ToolCapabilities::default(), - ) -} - -fn append_trailing_section_with_capabilities( +fn append_trailing_section( body: &str, prompts: &PromptCatalog, scope: &Scope, diff --git a/resources/prompts/common/tool-usage.md b/resources/prompts/common/tool-usage.md index 95a76002..e7489f4f 100644 --- a/resources/prompts/common/tool-usage.md +++ b/resources/prompts/common/tool-usage.md @@ -9,7 +9,7 @@ It is recommended to run tools that handle asynchronous processing, such as quer ### Memory and knowledge -Use memory and knowledge proactively when the request may depend on prior project decisions, historical rationale, durable user preferences, recently completed tickets, or established workflow/policy conventions. +{% if tool_capabilities.memory_records and tool_capabilities.knowledge_query %}Use memory and knowledge proactively{% elif tool_capabilities.memory_records %}Use memory proactively{% else %}Use knowledge proactively{% endif %} when the request may depend on prior project decisions, historical rationale, durable user preferences, recently completed tickets, or established workflow/policy conventions. {% if tool_capabilities.memory_query and tool_capabilities.knowledge_query %}Prefer a small targeted `MemoryQuery` / `KnowledgeQuery` before relying on vague recollection. {% elif tool_capabilities.memory_query %}Prefer a small targeted `MemoryQuery` before relying on vague recollection. {% elif tool_capabilities.knowledge_query %}Prefer a small targeted `KnowledgeQuery` before relying on vague recollection.