digest: modernize generate_digest() to use agent infrastructure

- Load template from digest.agent def (drop prompts_dir fallback)
- Resolve standard {{node:...}} placeholders — digest agent now gets
  core-personality, memory-instructions, subconscious notes
- Call through call_for_def_multi() with agent def's temperature,
  priority, and tools instead of call_simple()
- Move tool filtering from api.rs into callers (call_for_def_multi,
  run_one_agent_inner) — api takes pre-filtered &[Tool] slice

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-04 17:11:21 -04:00 committed by Kent Overstreet
commit 1457a1b50d
6 changed files with 182 additions and 109 deletions

View file

@ -34,7 +34,16 @@ pub(crate) fn call_for_def_multi(
bail_fn: Option<&(dyn Fn(usize) -> Result<(), String> + Sync)>,
log: &(dyn Fn(&str) + Sync),
) -> Result<String, String> {
super::api::call_api_with_tools_sync(&def.agent, prompts, phases, def.temperature, def.priority, &def.tools, bail_fn, log)
// Filter tools based on AgentDef specification
let all_tools = crate::agent::tools::memory_and_journal_tools();
let effective_tools: Vec<crate::agent::tools::Tool> = if def.tools.is_empty() {
all_tools
} else {
all_tools.into_iter()
.filter(|t| def.tools.iter().any(|w| w == &t.name))
.collect()
};
super::api::call_api_with_tools_sync(&def.agent, prompts, phases, def.temperature, def.priority, &effective_tools, bail_fn, log)
}