Fix --project flag not working in agent mode

- Add CommonFlags struct to group flags that apply across all modes
- Refactor run_agent_mode() to accept CommonFlags instead of individual params
- Add project loading logic for agent chat mode
- Add integration tests for --project with agent mode

This refactor prevents future bugs where new flags work in one mode
but are forgotten in another.
This commit is contained in:
Dhanji R. Prasanna
2026-01-30 11:28:48 +11:00
parent 51d22b3282
commit 2e21502357
4 changed files with 123 additions and 30 deletions

View File

@@ -90,17 +90,9 @@ pub async fn run() -> Result<()> {
if let Some(agent_name) = &cli.agent {
return run_agent_mode(
agent_name,
cli.workspace.clone(),
cli.config.as_deref(),
cli.quiet,
cli.new_session,
cli.task.clone(),
cli.chrome_headless,
cli.safari,
cli.chat,
cli.include_prompt.clone(),
cli.no_auto_memory,
cli.acd,
cli.common_flags(),
)
.await;
}