From cfd5d69cce0ccf9f85029f1518306100c984f7b4 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Sun, 11 Jan 2026 15:56:27 +0530 Subject: [PATCH] refactor: auto-enable auto-memory in agent mode Simplify auto-memory by always enabling it in agent mode instead of requiring the --auto-memory flag. This makes sense because: - Agent mode is non-interactive, so blocking is acceptable - Agents benefit from automatically saving discoveries to memory - Reduces flag complexity for users The --auto-memory flag still works for other modes if desired. --- crates/g3-cli/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/g3-cli/src/lib.rs b/crates/g3-cli/src/lib.rs index f0e6835..5eadf0d 100644 --- a/crates/g3-cli/src/lib.rs +++ b/crates/g3-cli/src/lib.rs @@ -440,7 +440,6 @@ pub async fn run() -> Result<()> { cli.task.clone(), cli.chrome_headless, cli.safari, - cli.auto_memory, ) .await; } @@ -456,7 +455,6 @@ pub async fn run() -> Result<()> { cli.task.clone(), cli.chrome_headless, cli.safari, - cli.auto_memory, ) .await; } @@ -703,7 +701,6 @@ async fn run_agent_mode( task: Option, chrome_headless: bool, safari: bool, - auto_memory: bool, ) -> Result<()> { use g3_core::get_agent_system_prompt; use g3_core::find_incomplete_agent_session; @@ -835,10 +832,9 @@ async fn run_agent_mode( // Set agent mode for session tracking agent.set_agent_mode(agent_name); - // Apply auto-memory flag if enabled - if auto_memory { - agent.set_auto_memory(true); - } + // Auto-memory is always enabled in agent mode + // This prompts the LLM to save discoveries to project memory after each turn + agent.set_auto_memory(true); // If resuming a session, restore context and TODO let initial_task = if let Some(ref incomplete_session) = resuming_session {