config resolves runtime configuration deterministically across defaults, user config, workspace config, and environment variables so every run has explicit, inspectable settings.
- Resolution order is fixed: defaults ->
~/.teaagent/config.json-><root>/.teaagent/config.json->TEAAGENT_*env vars (teaagent/config_loader.py:3,teaagent/config_loader.py:171). - Known keys only: only keys declared in
CONFIG_KEYSparticipate in merge (teaagent/config_loader.py:39); unknown file keys are ignored. - Type coercion is predictable: list values accept JSON arrays/comma-delimited strings; boolean env values treat
1/true/yesas true; invalid config JSON falls back to{}. - Source attribution is preserved: each resolved key records its winning layer (
ResolvedConfig.sources), andshow()emitskey = value [layer]lines. - Workspace loader safety:
load_workspace_config()reads only<root>/.teaagent/config.json; missing file returns{}.
ConfigResolver.resolve()returnsResolvedConfigwhere every key invalueshas a correspondingsourcesentry.- File-read and JSON-parse errors never crash resolution; lower-precedence layers continue.
None-resolved values are omitted fromResolvedConfig.values.- Environment variables always win when present.