Repository navigation
fix(claude): let an empty CLAUDE_SETTING_SOURCES load no settings - #426
Open
JodyeJack (2vqmgh2pbd-cmyk) wants to merge 1 commit into
Open
JodyeJack (2vqmgh2pbd-cmyk) wants to merge 1 commit into
JodyeJack (2vqmgh2pbd-cmyk) wants to merge 1 commit into
Conversation
The claude_chat backend passed --setting-sources only when CLAUDE_SETTING_SOURCES was non-empty. Without the flag the Claude CLI loads every source, so an empty value, the obvious way to ask for none, loaded the user's settings, hooks and CLAUDE.md into every rollout. The flag is now always passed. Unset keeps the user,project default; an empty value sends --setting-sources "", which loads none. The variable is documented in the configuration guide.
Contributor
|
JodyeJack (@2vqmgh2pbd-cmyk) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This branch has not been deployed
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.
Summary
The
claude_chatbackend now always passes--setting-sources, so an emptyCLAUDE_SETTING_SOURCESsends--setting-sources ""and loads no settings. Unset keeps theuser,projectdefault. Before, an empty value dropped the flag, and without the flag the Claude CLI loads every source.User impact: there was no way to run rollouts without the user's settings, hooks and
CLAUDE.md, and the empty value loaded all of them. This is theclaude_chatside of what #335 reported for SkillOpt-Sleep replays.Proof: the new test fails on
mainat22c1ed8for the empty and blank values and passes with this change.Reproduce
In a scratch shell, make a throwaway HOME with a canary
CLAUDE.mdand a hook that leaves a marker file. The throwaway HOME has no login, so exportCLAUDE_CODE_OAUTH_TOKENorANTHROPIC_API_KEYfirst.--setting-sourcesuser,projectPAPAYA-41PAPAYA-41""NONEClaude CLI 2.1.296, macOS.
Changes
claude_backend.pystrips the value and passes--setting-sourceseven when it is empty.docs/guide/configuration.mddocumentsCLAUDE_SETTING_SOURCES.tests/test_claude_backend_setting_sources.pyloads a fresh copy of the module for unset, empty, blank anduservalues and checks the flag the CLI receives.Question
Should the default become
"", the way #336 isolates SkillOpt-Sleep replays? This PR keepsuser,project, because settings-based auth such asapiKeyHelperwould stop working without it. It only makes the empty value mean none.Tests
python -m pytest -qon macOS, rebased onmainat22c1ed8: 2346 passed (2342 onmain). The only failures are the two tests intests/test_sleep_adopt_skill_subset.pythat also fail onmainon macOS, where the temporary directory sits behind the/varsymlink.mkdocs build --strictpasses.