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.
This commit is contained in:
Dhanji R. Prasanna
2026-01-11 15:56:27 +05:30
parent 1575cafc4b
commit cfd5d69cce

View File

@@ -440,7 +440,6 @@ pub async fn run() -> Result<()> {
cli.task.clone(), cli.task.clone(),
cli.chrome_headless, cli.chrome_headless,
cli.safari, cli.safari,
cli.auto_memory,
) )
.await; .await;
} }
@@ -456,7 +455,6 @@ pub async fn run() -> Result<()> {
cli.task.clone(), cli.task.clone(),
cli.chrome_headless, cli.chrome_headless,
cli.safari, cli.safari,
cli.auto_memory,
) )
.await; .await;
} }
@@ -703,7 +701,6 @@ async fn run_agent_mode(
task: Option<String>, task: Option<String>,
chrome_headless: bool, chrome_headless: bool,
safari: bool, safari: bool,
auto_memory: bool,
) -> Result<()> { ) -> Result<()> {
use g3_core::get_agent_system_prompt; use g3_core::get_agent_system_prompt;
use g3_core::find_incomplete_agent_session; use g3_core::find_incomplete_agent_session;
@@ -835,10 +832,9 @@ async fn run_agent_mode(
// Set agent mode for session tracking // Set agent mode for session tracking
agent.set_agent_mode(agent_name); agent.set_agent_mode(agent_name);
// Apply auto-memory flag if enabled // Auto-memory is always enabled in agent mode
if auto_memory { // This prompts the LLM to save discoveries to project memory after each turn
agent.set_auto_memory(true); agent.set_auto_memory(true);
}
// If resuming a session, restore context and TODO // If resuming a session, restore context and TODO
let initial_task = if let Some(ref incomplete_session) = resuming_session { let initial_task = if let Some(ref incomplete_session) = resuming_session {