memory: clean prompt helper warning

This commit is contained in:
Keisuke Hirata 2026-06-01 07:50:27 +09:00
parent 03256db913
commit 3a0c8e1597
No known key found for this signature in database
2 changed files with 3 additions and 24 deletions

View File

@ -117,7 +117,7 @@ impl SystemPromptTemplate {
let body = tmpl let body = tmpl
.render(ctx.to_minijinja_value()) .render(ctx.to_minijinja_value())
.map_err(|e| SystemPromptError::Render(e.to_string()))?; .map_err(|e| SystemPromptError::Render(e.to_string()))?;
append_trailing_section_with_capabilities( append_trailing_section(
&body, &body,
ctx.prompts, ctx.prompts,
ctx.scope, ctx.scope,
@ -272,28 +272,7 @@ impl ToolCapabilities {
/// comes from the prompt catalog (`PodPrompt::WorkingBoundariesSection` /// comes from the prompt catalog (`PodPrompt::WorkingBoundariesSection`
/// / `PodPrompt::AgentsMdSection`) so that wording can be overridden /// / `PodPrompt::AgentsMdSection`) so that wording can be overridden
/// per-pack without touching this function. /// per-pack without touching this function.
pub fn append_trailing_section( 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<String, SystemPromptError> {
append_trailing_section_with_capabilities(
body,
prompts,
scope,
agents_md,
resident_summary,
resident_knowledge,
resident_workflows,
ToolCapabilities::default(),
)
}
fn append_trailing_section_with_capabilities(
body: &str, body: &str,
prompts: &PromptCatalog, prompts: &PromptCatalog,
scope: &Scope, scope: &Scope,

View File

@ -9,7 +9,7 @@ It is recommended to run tools that handle asynchronous processing, such as quer
### Memory and knowledge ### 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. {% 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.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. {% elif tool_capabilities.knowledge_query %}Prefer a small targeted `KnowledgeQuery` before relying on vague recollection.