feat(cli): wire --settings <file> as a trusted highest-precedence override#164
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--settingswas 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, exposeslayers.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.)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 exitsFatal. core 642 · cli 137, typecheck + repo-wideformat:checkclean.Doc:
--settingsrow 🔄 → 🟡 (siblings--agents/--mcp-config/--plugin-dir/--plugin-urlremain parsed-only).🤖 Generated with Claude Code