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.
This commit is contained in:
Dhanji R. Prasanna
2026-01-17 15:24:16 +05:30
parent 6bb5448d3f
commit b0740b63c2
3 changed files with 8 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ pub async fn run_agent_mode(
safari: bool,
chat: bool,
include_prompt_path: Option<PathBuf>,
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 {

View File

@@ -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<PathBuf>,
/// Disable automatic memory update reminder at end of agent mode
#[arg(long)]
pub no_auto_memory: bool,
}

View File

@@ -90,6 +90,7 @@ pub async fn run() -> Result<()> {
cli.safari,
cli.chat,
cli.include_prompt.clone(),
cli.no_auto_memory,
)
.await;
}