fix(transport): respect empty setting_sources for agent isolation#874
Open
UmmeHabiba1312 wants to merge 1 commit intoanthropics:mainfrom
Open
fix(transport): respect empty setting_sources for agent isolation#874UmmeHabiba1312 wants to merge 1 commit intoanthropics:mainfrom
UmmeHabiba1312 wants to merge 1 commit intoanthropics:mainfrom
Conversation
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.
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