From b0740b63c2146cfda1e11df3e66cae054f0435ce Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Sat, 17 Jan 2026 15:24:16 +0530 Subject: [PATCH] feat(cli): add --no-auto-memory flag to disable memory reminder in agent mode Adds a flag to disable the automatic memory update reminder that runs at the end of agent mode. Useful when running agents that should not modify project memory. --- crates/g3-cli/src/agent_mode.rs | 5 +++-- crates/g3-cli/src/cli_args.rs | 4 ++++ crates/g3-cli/src/lib.rs | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/g3-cli/src/agent_mode.rs b/crates/g3-cli/src/agent_mode.rs index 0532795..148df85 100644 --- a/crates/g3-cli/src/agent_mode.rs +++ b/crates/g3-cli/src/agent_mode.rs @@ -26,6 +26,7 @@ pub async fn run_agent_mode( safari: bool, chat: bool, include_prompt_path: Option, + no_auto_memory: bool, ) -> Result<()> { use g3_core::find_incomplete_agent_session; use g3_core::get_agent_system_prompt; @@ -210,9 +211,9 @@ pub async fn run_agent_mode( // Set agent mode for session tracking agent.set_agent_mode(agent_name); - // Auto-memory is always enabled in agent mode + // Auto-memory is enabled by default in agent mode (unless --no-auto-memory is set) // This prompts the LLM to save discoveries to project memory after each turn - agent.set_auto_memory(true); + agent.set_auto_memory(!no_auto_memory); // If resuming a session, restore context and TODO let initial_task = if let Some(ref incomplete_session) = resuming_session { diff --git a/crates/g3-cli/src/cli_args.rs b/crates/g3-cli/src/cli_args.rs index 720c1ec..47bf5a1 100644 --- a/crates/g3-cli/src/cli_args.rs +++ b/crates/g3-cli/src/cli_args.rs @@ -118,4 +118,8 @@ pub struct Cli { /// Include additional prompt content from a file (appended before memory) #[arg(long, value_name = "PATH")] pub include_prompt: Option, + + /// Disable automatic memory update reminder at end of agent mode + #[arg(long)] + pub no_auto_memory: bool, } diff --git a/crates/g3-cli/src/lib.rs b/crates/g3-cli/src/lib.rs index 9bf9df5..687dd5c 100644 --- a/crates/g3-cli/src/lib.rs +++ b/crates/g3-cli/src/lib.rs @@ -90,6 +90,7 @@ pub async fn run() -> Result<()> { cli.safari, cli.chat, cli.include_prompt.clone(), + cli.no_auto_memory, ) .await; }