Version: cli-dispatch 4.27.0
When cli-dispatch-run --backend ag --model claude-sonnet-4-6 ... launches ag-worktree-run.sh, the runner forwards the selection as AG_MODEL in the environment. ag-stream then calls source_config before reading MODEL="${AG_MODEL:-}"; source_config sources the config file unconditionally, so a configured AG_MODEL=gemini-3.6-flash-high overwrites the explicit runner selection.
Observed output:
ag-stream: warning — model "gemini-3.6-flash-high" is not listed by `agy models`
The same occurred when setting AG_MODEL=claude-sonnet-4-6 directly on cli-dispatch-run. Using a task-specific CLI_DISPATCH_CONFIG containing the desired model changed the observed model, confirming the overwrite path.
Expected: explicit --model / inherited env override wins over the config, matching the stream-utils.sh comment “env wins”.
Possible fix: have source_config preserve already-set variables, or pass --model through ag-worktree-run.sh to ag-stream so argument parsing wins after config sourcing.
Version: cli-dispatch 4.27.0
When
cli-dispatch-run --backend ag --model claude-sonnet-4-6 ...launchesag-worktree-run.sh, the runner forwards the selection asAG_MODELin the environment.ag-streamthen callssource_configbefore readingMODEL="${AG_MODEL:-}";source_configsources the config file unconditionally, so a configuredAG_MODEL=gemini-3.6-flash-highoverwrites the explicit runner selection.Observed output:
The same occurred when setting
AG_MODEL=claude-sonnet-4-6directly oncli-dispatch-run. Using a task-specificCLI_DISPATCH_CONFIGcontaining the desired model changed the observed model, confirming the overwrite path.Expected: explicit
--model/ inherited env override wins over the config, matching thestream-utils.shcomment “env wins”.Possible fix: have
source_configpreserve already-set variables, or pass--modelthroughag-worktree-run.shtoag-streamso argument parsing wins after config sourcing.