Skip to content

fix(transport): respect empty setting_sources for agent isolation#874

Open
UmmeHabiba1312 wants to merge 1 commit intoanthropics:mainfrom
UmmeHabiba1312:fix/setting-sources-isolation
Open

fix(transport): respect empty setting_sources for agent isolation#874
UmmeHabiba1312 wants to merge 1 commit intoanthropics:mainfrom
UmmeHabiba1312:fix/setting-sources-isolation

Conversation

@UmmeHabiba1312
Copy link
Copy Markdown

This PR fixes an issue where passing an empty list [] to setting_sources was ignored by the subprocess transport. Because an empty list evaluates to False in Python, the SDK would ignore a user's request for agent isolation and fall back to loading default user and project settings.

Changes

Updated the conditional check in subprocess_cli.py from if effective_setting_sources: to if effective_setting_sources is not None:.

This ensures that an empty list is correctly passed to the CLI as an empty flag (--setting-sources=), which explicitly disables external setting discovery.

Validation

Manual Verification: Used a reproduction script to confirm that the flag is now correctly appended to the spawned process command when setting_sources=[] is provided.

Regression Testing: Ran pytest tests/test_transport.py and all 81 tests passed successfully.

Fixes #853

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.

setting_sources=[] does not filter OAuth-fetched claude.ai-account MCP servers

1 participant