poc-memory agent run: single agent execution with dry-run
New command: `poc-memory agent run <agent> [--count N] [--dry-run]` Runs a single agent by name through the full pipeline (build prompt, call LLM, apply actions). With --dry-run, sets POC_MEMORY_DRY_RUN=1 so all mutations are no-ops but the agent can still read the graph. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7e131862d6
commit
f0df489465
2 changed files with 26 additions and 0 deletions
|
|
@ -5,6 +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) -> 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);
|
||||
let (total, applied) = crate::agents::knowledge::run_and_apply_with_log(
|
||||
&mut store, agent, count, "test", &log,
|
||||
)?;
|
||||
eprintln!("[{}] {} actions, {} applied", agent, total, applied);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn cmd_consolidate_batch(count: usize, auto: bool, agent: Option<String>) -> Result<(), String> {
|
||||
let store = store::Store::load()?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue