From ecea49d328a75916a619e1964a92031b3c89572c Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Tue, 20 Jan 2026 14:12:40 +0530 Subject: [PATCH] Fix --acd flag not being passed to agent mode The --acd flag was being checked AFTER the agent mode early return, so it was never applied when running with --agent. Fix: Pass acd_enabled parameter to run_agent_mode() and call agent.set_acd_enabled(true) when the flag is set. --- crates/g3-cli/src/agent_mode.rs | 6 ++++++ crates/g3-cli/src/lib.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/crates/g3-cli/src/agent_mode.rs b/crates/g3-cli/src/agent_mode.rs index 98745ef..f14164d 100644 --- a/crates/g3-cli/src/agent_mode.rs +++ b/crates/g3-cli/src/agent_mode.rs @@ -27,6 +27,7 @@ pub async fn run_agent_mode( chat: bool, include_prompt_path: Option, no_auto_memory: bool, + acd_enabled: bool, ) -> Result<()> { use g3_core::find_incomplete_agent_session; use g3_core::get_agent_system_prompt; @@ -218,6 +219,11 @@ pub async fn run_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(!no_auto_memory); + + // Enable ACD (Aggressive Context Dehydration) if requested + if acd_enabled { + agent.set_acd_enabled(true); + } // 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/lib.rs b/crates/g3-cli/src/lib.rs index b852640..4adf8e0 100644 --- a/crates/g3-cli/src/lib.rs +++ b/crates/g3-cli/src/lib.rs @@ -93,6 +93,7 @@ pub async fn run() -> Result<()> { cli.chat, cli.include_prompt.clone(), cli.no_auto_memory, + cli.acd, ) .await; }