Skip to content

feat(cli): wire --settings <file> as a trusted highest-precedence override#164

Merged
oratis merged 1 commit into
mainfrom
feat/cli-settings-override
Jun 7, 2026
Merged

feat(cli): wire --settings <file> as a trusted highest-precedence override#164
oratis merged 1 commit into
mainfrom
feat/cli-settings-override

Conversation

@oratis
Copy link
Copy Markdown
Owner

@oratis oratis commented Jun 7, 2026

--settings was parsed but ignored. Now it loads a settings file that wins over all discovered layers (user / project / local).

  • loadSettings: reads the override (required — a missing/unparseable file is a hard error, not a silent skip), merges it on top, exposes layers.override + sources.overridePath.
  • gateUntrustedSettings: the override is an explicit user choice → trusted, so its exec fields (hooks / mcpServers / apiKeyHelper / statusLine) survive even in an untrusted directory — unlike project/local, which stay gated. (This is the subtlety I flagged earlier; handled deliberately + tested.)
  • Threaded through startRepl + runHeadless + cli.

Tests: loader (override wins / missing file throws) + trust-gate (override's hooks survive untrusted). Smoke-verified end-to-end — --settings <file> model + effort win in the banner; a bad path exits Fatal. core 642 · cli 137, typecheck + repo-wide format:check clean.

Doc: --settings row 🔄 → 🟡 (siblings --agents/--mcp-config/--plugin-dir/--plugin-url remain parsed-only).

🤖 Generated with Claude Code

…rride

--settings was parsed but ignored. Now it loads a settings file that wins over
all discovered layers (user / project / local).

- loadSettings: reads the override (REQUIRED — a missing/unparseable file is a
  hard error, not a silent skip), merges it on top, exposes it as
  layers.override + sources.overridePath.
- gateUntrustedSettings: the override is an explicit user choice → TRUSTED, so
  its exec fields (hooks/mcpServers/apiKeyHelper/statusLine) survive even in an
  untrusted directory (unlike project/local, which are still gated).
- Threaded through startRepl + runHeadless + cli.

Tests: loader (override wins / missing file throws) + trust-gate (override's
hooks survive untrusted). Smoke-verified end-to-end: `--settings <file>` model
+ effort win in the banner; a bad path exits with a Fatal error. core 642 · cli 137.

Doc: --settings row 🔄 → 🟡 (the sibling --agents/--mcp-config/--plugin-dir/
--plugin-url remain parsed-only).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@oratis oratis merged commit 675c909 into main Jun 7, 2026
3 checks passed
@oratis oratis deleted the feat/cli-settings-override branch June 7, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant