Skip to content

Commit 8bf34b6

Browse files
committed
fix(cli): pass --model flag to ConfigOverrides in run command
Fixes bounty issue #1485 The --model CLI flag was being captured but ignored because run_cmd.rs used Config::default() instead of Config::load_sync() with the model override. This change creates ConfigOverrides with the model and cwd fields from CLI arguments, ensuring CLI flags take precedence over agent defaults.
1 parent 5579873 commit 8bf34b6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cortex-cli/src/run_cmd.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,13 @@ impl RunCli {
398398
let is_json = matches!(self.format, OutputFormat::Json | OutputFormat::Jsonl);
399399
let is_terminal = io::stdout().is_terminal();
400400

401-
// Create or resume session
402-
let config = cortex_engine::Config::default();
401+
// Create or resume session with CLI overrides
402+
let overrides = cortex_engine::ConfigOverrides {
403+
model: self.model.clone(),
404+
cwd: self.cwd.clone(),
405+
..Default::default()
406+
};
407+
let config = cortex_engine::Config::load_sync(overrides).unwrap_or_default();
403408

404409
// Initialize custom command registry if not already initialized
405410
let project_root = self.cwd.clone().or_else(|| std::env::current_dir().ok());

0 commit comments

Comments
 (0)