remove --debug flag from agent run
The log file has everything now; --debug was redundant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
543e1bdc8a
commit
e3f7d6bd3c
4 changed files with 13 additions and 20 deletions
|
|
@ -132,7 +132,7 @@ fn job_targeted_agent(
|
||||||
log_event(&job_name, "progress", msg);
|
log_event(&job_name, "progress", msg);
|
||||||
};
|
};
|
||||||
super::knowledge::run_one_agent_with_keys(
|
super::knowledge::run_one_agent_with_keys(
|
||||||
&mut store, &agent, std::slice::from_ref(&key), 5, "daemon", &log, false,
|
&mut store, &agent, std::slice::from_ref(&key), 5, "daemon", &log,
|
||||||
)?;
|
)?;
|
||||||
ctx.log_line("done");
|
ctx.log_line("done");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -217,7 +217,7 @@ fn job_consolidation_agent(
|
||||||
// Use run_one_agent_with_keys — we already selected seeds above,
|
// Use run_one_agent_with_keys — we already selected seeds above,
|
||||||
// no need to re-run the query.
|
// no need to re-run the query.
|
||||||
let result = super::knowledge::run_one_agent_with_keys(
|
let result = super::knowledge::run_one_agent_with_keys(
|
||||||
&mut store, &agent, &claimed_keys, batch, "consolidate", &log, false,
|
&mut store, &agent, &claimed_keys, batch, "consolidate", &log,
|
||||||
).map(|_| ());
|
).map(|_| ());
|
||||||
|
|
||||||
// Release all claimed keys (seeds + neighbors)
|
// Release all claimed keys (seeds + neighbors)
|
||||||
|
|
@ -247,7 +247,7 @@ fn job_rename_agent(
|
||||||
ctx.log_line(format!("running rename agent (batch={})", batch));
|
ctx.log_line(format!("running rename agent (batch={})", batch));
|
||||||
|
|
||||||
let log = |msg: &str| ctx.log_line(msg);
|
let log = |msg: &str| ctx.log_line(msg);
|
||||||
let result = super::knowledge::run_one_agent(&mut store, "rename", batch, "consolidate", &log, false)?;
|
let result = super::knowledge::run_one_agent(&mut store, "rename", batch, "consolidate", &log)?;
|
||||||
|
|
||||||
// Parse RENAME actions from response (rename uses its own format, not WRITE_NODE/LINK/REFINE)
|
// Parse RENAME actions from response (rename uses its own format, not WRITE_NODE/LINK/REFINE)
|
||||||
let mut applied = 0;
|
let mut applied = 0;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ pub fn run_and_apply_excluded(
|
||||||
log: &(dyn Fn(&str) + Sync),
|
log: &(dyn Fn(&str) + Sync),
|
||||||
exclude: &std::collections::HashSet<String>,
|
exclude: &std::collections::HashSet<String>,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let result = run_one_agent_excluded(store, agent_name, batch_size, llm_tag, log, false, exclude)?;
|
let result = run_one_agent_excluded(store, agent_name, batch_size, llm_tag, log, exclude)?;
|
||||||
|
|
||||||
// Mark conversation segments as mined after successful processing
|
// Mark conversation segments as mined after successful processing
|
||||||
if agent_name == "observation" {
|
if agent_name == "observation" {
|
||||||
|
|
@ -72,7 +72,6 @@ pub fn run_one_agent_with_keys(
|
||||||
count: usize,
|
count: usize,
|
||||||
llm_tag: &str,
|
llm_tag: &str,
|
||||||
log: &(dyn Fn(&str) + Sync),
|
log: &(dyn Fn(&str) + Sync),
|
||||||
debug: bool,
|
|
||||||
) -> Result<AgentResult, String> {
|
) -> Result<AgentResult, String> {
|
||||||
let def = super::defs::get_def(agent_name)
|
let def = super::defs::get_def(agent_name)
|
||||||
.ok_or_else(|| format!("no .agent file for {}", agent_name))?;
|
.ok_or_else(|| format!("no .agent file for {}", agent_name))?;
|
||||||
|
|
@ -91,7 +90,7 @@ pub fn run_one_agent_with_keys(
|
||||||
store.record_agent_visits(&agent_batch.node_keys, agent_name).ok();
|
store.record_agent_visits(&agent_batch.node_keys, agent_name).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
run_one_agent_inner(store, agent_name, &def, agent_batch, llm_tag, log, debug)
|
run_one_agent_inner(store, agent_name, &def, agent_batch, llm_tag, log)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_one_agent(
|
pub fn run_one_agent(
|
||||||
|
|
@ -100,9 +99,8 @@ pub fn run_one_agent(
|
||||||
batch_size: usize,
|
batch_size: usize,
|
||||||
llm_tag: &str,
|
llm_tag: &str,
|
||||||
log: &(dyn Fn(&str) + Sync),
|
log: &(dyn Fn(&str) + Sync),
|
||||||
debug: bool,
|
|
||||||
) -> Result<AgentResult, String> {
|
) -> Result<AgentResult, String> {
|
||||||
run_one_agent_excluded(store, agent_name, batch_size, llm_tag, log, debug, &Default::default())
|
run_one_agent_excluded(store, agent_name, batch_size, llm_tag, log, &Default::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Like run_one_agent but excludes nodes currently being worked on by other agents.
|
/// Like run_one_agent but excludes nodes currently being worked on by other agents.
|
||||||
|
|
@ -112,7 +110,6 @@ pub fn run_one_agent_excluded(
|
||||||
batch_size: usize,
|
batch_size: usize,
|
||||||
llm_tag: &str,
|
llm_tag: &str,
|
||||||
log: &(dyn Fn(&str) + Sync),
|
log: &(dyn Fn(&str) + Sync),
|
||||||
debug: bool,
|
|
||||||
exclude: &std::collections::HashSet<String>,
|
exclude: &std::collections::HashSet<String>,
|
||||||
) -> Result<AgentResult, String> {
|
) -> Result<AgentResult, String> {
|
||||||
let def = super::defs::get_def(agent_name)
|
let def = super::defs::get_def(agent_name)
|
||||||
|
|
@ -122,7 +119,7 @@ pub fn run_one_agent_excluded(
|
||||||
let effective_count = def.count.unwrap_or(batch_size);
|
let effective_count = def.count.unwrap_or(batch_size);
|
||||||
let agent_batch = super::defs::run_agent(store, &def, effective_count, exclude)?;
|
let agent_batch = super::defs::run_agent(store, &def, effective_count, exclude)?;
|
||||||
|
|
||||||
run_one_agent_inner(store, agent_name, &def, agent_batch, llm_tag, log, debug)
|
run_one_agent_inner(store, agent_name, &def, agent_batch, llm_tag, log)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_one_agent_inner(
|
fn run_one_agent_inner(
|
||||||
|
|
@ -132,7 +129,6 @@ fn run_one_agent_inner(
|
||||||
agent_batch: super::prompts::AgentBatch,
|
agent_batch: super::prompts::AgentBatch,
|
||||||
_llm_tag: &str,
|
_llm_tag: &str,
|
||||||
log: &(dyn Fn(&str) + Sync),
|
log: &(dyn Fn(&str) + Sync),
|
||||||
debug: bool,
|
|
||||||
) -> Result<AgentResult, String> {
|
) -> Result<AgentResult, String> {
|
||||||
let prompt_kb = agent_batch.prompt.len() / 1024;
|
let prompt_kb = agent_batch.prompt.len() / 1024;
|
||||||
let tools_desc = if def.tools.is_empty() { "no tools".into() }
|
let tools_desc = if def.tools.is_empty() { "no tools".into() }
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
use crate::store;
|
use crate::store;
|
||||||
use crate::agents::llm;
|
use crate::agents::llm;
|
||||||
|
|
||||||
pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], query: Option<&str>, dry_run: bool, debug: bool, local: bool) -> Result<(), String> {
|
pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], query: Option<&str>, dry_run: bool, local: bool) -> Result<(), String> {
|
||||||
if dry_run {
|
if dry_run {
|
||||||
// SAFETY: single-threaded at this point (CLI startup, before any agent work)
|
// SAFETY: single-threaded at this point (CLI startup, before any agent work)
|
||||||
unsafe { std::env::set_var("POC_MEMORY_DRY_RUN", "1"); }
|
unsafe { std::env::set_var("POC_MEMORY_DRY_RUN", "1"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
let needs_local = local || debug || dry_run;
|
let needs_local = local || dry_run;
|
||||||
let has_targets = !target.is_empty() || query.is_some();
|
let has_targets = !target.is_empty() || query.is_some();
|
||||||
|
|
||||||
// Fast path: no explicit targets, daemon available — just queue via RPC
|
// Fast path: no explicit targets, daemon available — just queue via RPC
|
||||||
|
|
@ -51,7 +51,7 @@ pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], query: Option
|
||||||
println!("[{}] [{}/{}] {}", agent, i + 1, resolved_targets.len(), key);
|
println!("[{}] [{}/{}] {}", agent, i + 1, resolved_targets.len(), key);
|
||||||
if i > 0 { store = store::Store::load()?; }
|
if i > 0 { store = store::Store::load()?; }
|
||||||
if let Err(e) = crate::agents::knowledge::run_one_agent_with_keys(
|
if let Err(e) = crate::agents::knowledge::run_one_agent_with_keys(
|
||||||
&mut store, agent, &[key.clone()], count, "test", &log, debug,
|
&mut store, agent, &[key.clone()], count, "test", &log,
|
||||||
) {
|
) {
|
||||||
println!("[{}] ERROR on {}: {}", agent, key, e);
|
println!("[{}] ERROR on {}: {}", agent, key, e);
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +71,7 @@ pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], query: Option
|
||||||
} else {
|
} else {
|
||||||
// Local execution (--local, --debug, dry-run, or daemon unavailable)
|
// Local execution (--local, --debug, dry-run, or daemon unavailable)
|
||||||
crate::agents::knowledge::run_one_agent(
|
crate::agents::knowledge::run_one_agent(
|
||||||
&mut store, agent, count, "test", &log, debug,
|
&mut store, agent, count, "test", &log,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -611,9 +611,6 @@ enum AgentCmd {
|
||||||
/// Dry run — set POC_MEMORY_DRY_RUN=1 so mutations are no-ops
|
/// Dry run — set POC_MEMORY_DRY_RUN=1 so mutations are no-ops
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
dry_run: bool,
|
dry_run: bool,
|
||||||
/// Debug — print full prompt and response
|
|
||||||
#[arg(long)]
|
|
||||||
debug: bool,
|
|
||||||
/// Run locally instead of queuing to daemon
|
/// Run locally instead of queuing to daemon
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
local: bool,
|
local: bool,
|
||||||
|
|
@ -865,8 +862,8 @@ fn main() {
|
||||||
AgentCmd::FactMine { path, batch, dry_run, output, min_messages }
|
AgentCmd::FactMine { path, batch, dry_run, output, min_messages }
|
||||||
=> cli::agent::cmd_fact_mine(&path, batch, dry_run, output.as_deref(), min_messages),
|
=> cli::agent::cmd_fact_mine(&path, batch, dry_run, output.as_deref(), min_messages),
|
||||||
AgentCmd::FactMineStore { path } => cli::agent::cmd_fact_mine_store(&path),
|
AgentCmd::FactMineStore { path } => cli::agent::cmd_fact_mine_store(&path),
|
||||||
AgentCmd::Run { agent, count, target, query, dry_run, debug, local }
|
AgentCmd::Run { agent, count, target, query, dry_run, local }
|
||||||
=> cli::agent::cmd_run_agent(&agent, count, &target, query.as_deref(), dry_run, debug, local),
|
=> cli::agent::cmd_run_agent(&agent, count, &target, query.as_deref(), dry_run, local),
|
||||||
AgentCmd::ReplayQueue { count } => cli::agent::cmd_replay_queue(count),
|
AgentCmd::ReplayQueue { count } => cli::agent::cmd_replay_queue(count),
|
||||||
AgentCmd::Evaluate { matchups, model, dry_run }
|
AgentCmd::Evaluate { matchups, model, dry_run }
|
||||||
=> cli::agent::cmd_evaluate_agents(matchups, &model, dry_run),
|
=> cli::agent::cmd_evaluate_agents(matchups, &model, dry_run),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue