agent run: add --target flag to run agents on specific nodes

Adds run_one_agent_with_keys() which bypasses the agent's query and
uses explicitly provided node keys. This allows testing agents on
specific graph neighborhoods:

  poc-memory agent run linker --target bcachefs --debug
This commit is contained in:
ProofOfConcept 2026-03-17 00:24:24 -04:00
parent 1aad6d90af
commit 8b959fb68d
3 changed files with 50 additions and 5 deletions

View file

@ -5,14 +5,19 @@ use crate::store::StoreView;
use crate::agents::llm;
use std::sync::atomic::{AtomicUsize, Ordering};
pub fn cmd_run_agent(agent: &str, count: usize, dry_run: bool, debug: bool) -> Result<(), String> {
pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], dry_run: bool, debug: bool) -> Result<(), String> {
if dry_run {
std::env::set_var("POC_MEMORY_DRY_RUN", "1");
}
let mut store = store::Store::load()?;
let log = |msg: &str| eprintln!("[{}] {}", agent, msg);
if debug {
if !target.is_empty() {
// Override agent's query with explicit target keys
crate::agents::knowledge::run_one_agent_with_keys(
&mut store, agent, target, count, "test", &log, debug,
)?;
} else if debug {
crate::agents::knowledge::run_one_agent(
&mut store, agent, count, "test", &log, true,
)?;