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.
This commit is contained in:
Dhanji R. Prasanna
2026-01-20 14:12:40 +05:30
parent 1ec01bb4e3
commit ecea49d328
2 changed files with 7 additions and 0 deletions

View File

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

View File

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