If you export a new COMETAPI_DEFAULT_MODEL (or another CLI setting) and nothing changes, check the precedence before changing the workload or retrying the request.
The CometAPI CLI documents this order:
CLI flags > config file > environment variables > defaults
That means an existing value in ~/.config/cometapi/config.toml can continue to win over the environment variable you just exported. A command-line flag wins over both.
A bounded troubleshooting sequence:
- Check the config location with
cometapi config path.
- Inspect the current configuration with
cometapi config show, taking care not to copy credentials into logs or tickets.
- Search the invocation for a flag that sets the same option; it has the highest priority.
- If the config file is meant to stop governing the setting, change or remove that key with the documented
config set or config unset commands, then run the command again.
- If the environment is meant to be the fallback, keep the higher-priority sources absent and verify the resulting behavior with a non-sensitive setting first.
This is a configuration-precedence diagnosis, not a claim about a particular installed version. The documentation says API keys and access tokens are masked in diagnostics and warns against committing the config file or other credentials, so comparison output should be sanitized rather than pasted verbatim.
For an agent that launches the CLI as a tool, precedence also becomes a control-boundary question: which settings may the agent choose, and which must remain fixed by the wrapper?
Given the documented order, an environment variable alone is not a reliable way to pin a model for an evaluation. A config entry or generated flag can override it, so two runs labeled with the same environment value could be testing different configurations.
My design recommendation would be to resolve permitted non-secret settings before launching a multi-step run, then keep that configuration fixed across its steps. If the wrapper pins a setting with a flag, it should also reject conflicting agent-supplied arguments rather than append both and assume which duplicate wins; the precedence rule does not establish duplicate-flag behavior.
A useful preflight test would deliberately place conflicting non-secret model values in the environment, config, and wrapper arguments, then check the selected model using whatever observable evidence the installed version actually provides. If selection cannot be established, mark the evaluation configuration unverified rather than interpreting a quality change as model behavior. Record only an allowlisted settings summary, not the full config or command line. This is a proposed wrapper test, not a claim that the CLI enforces such a boundary itself.