Loader for ~/.pixir/config.json (ADR 0005 ergonomics).
Parses user-global knobs, ignores invalid values with warnings (never hard-fails on a bad field), and resolves effective values with this precedence for each key:
config :pixir, :key(programmatic override)~/.pixir/config.json- built-in default
Model id keeps the Provider chain: config :pixir, :model → PIXIR_MODEL →
"model" in config.json → built-in default.
Legacy keys (model, models, context_windows) remain supported alongside the
expanded surface (permission_default, reasoning.effort, text.verbosity,
bash_timeout_ms, max_retries, stream_idle_timeout_ms, compaction.tail_events).
Summary
Functions
Whether model-assisted compaction is enabled (default false).
Context-window overrides from config.json (model => positive integer).
Model slug from config.json only (no env/app precedence).
Models list from config.json only, or nil when absent/invalid.
Load and resolve config.json.
Merge config defaults into Provider opts without clobbering explicit values.
Resolved permission default (:auto, :ask, or :read_only).
Resolved reasoning effort, or nil to omit and let the model default.
Resolved text verbosity, or nil to omit and let the model default.
Types
Functions
@spec bash_timeout_ms(keyword()) :: pos_integer()
Whether model-assisted compaction is enabled (default false).
@spec compaction_tail_events(keyword()) :: pos_integer()
@spec file_context_windows(keyword()) :: %{required(String.t()) => pos_integer()}
Context-window overrides from config.json (model => positive integer).
Model slug from config.json only (no env/app precedence).
Models list from config.json only, or nil when absent/invalid.
@spec load(keyword()) :: load_result()
Load and resolve config.json.
Returns a JSON-serializable map with "path", "present", "effective", and
"warnings". Missing files yield defaults and an empty warning list.
@spec max_retries(keyword()) :: non_neg_integer()
Merge config defaults into Provider opts without clobbering explicit values.
@spec permission_default(keyword()) :: Pixir.Permissions.mode()
Resolved permission default (:auto, :ask, or :read_only).
Resolved reasoning effort, or nil to omit and let the model default.
@spec stream_idle_timeout_ms(keyword()) :: non_neg_integer()
Resolved text verbosity, or nil to omit and let the model default.