Reproduction
- Configure
AG_MODEL=gemini-3.6-flash-high in ~/.config/cli-dispatch/config.
- Run
cli-dispatch-run --backend ag --model claude-sonnet-4-6 ....
- Observe
ag-stream launches with gemini-3.6-flash-high.
Cause
cli-dispatch-run correctly invokes the backend runner with env AG_MODEL=claude-sonnet-4-6, but ag-stream calls source_config before reading MODEL. source_config sources the config directly and overwrites an already-exported environment variable, contrary to its env wins contract.
There is a related validation false warning: model_listed() normalizes and compares the requested slug against each whole slug<TAB>display-name line from agy models, so a valid claude-sonnet-4-6 slug is reported as unlisted.
Expected
Per-call --model / inherited backend env should take precedence over config defaults, and a valid slug from the first column of agy models should validate without warning.
Observed on cli-dispatch 4.27.0, macOS.
Reproduction
AG_MODEL=gemini-3.6-flash-highin~/.config/cli-dispatch/config.cli-dispatch-run --backend ag --model claude-sonnet-4-6 ....ag-streamlaunches withgemini-3.6-flash-high.Cause
cli-dispatch-runcorrectly invokes the backend runner withenv AG_MODEL=claude-sonnet-4-6, butag-streamcallssource_configbefore readingMODEL.source_configsources the config directly and overwrites an already-exported environment variable, contrary to itsenv winscontract.There is a related validation false warning:
model_listed()normalizes and compares the requested slug against each wholeslug<TAB>display-nameline fromagy models, so a validclaude-sonnet-4-6slug is reported as unlisted.Expected
Per-call
--model/ inherited backend env should take precedence over config defaults, and a valid slug from the first column ofagy modelsshould validate without warning.Observed on cli-dispatch 4.27.0, macOS.