Skip to content

Fix relative settings file resolution when merging sandbox config#663

Open
shuofengzhang wants to merge 1 commit intoanthropics:mainfrom
shuofengzhang:fix/resolve-relative-settings-path
Open

Fix relative settings file resolution when merging sandbox config#663
shuofengzhang wants to merge 1 commit intoanthropics:mainfrom
shuofengzhang:fix/resolve-relative-settings-path

Conversation

@shuofengzhang
Copy link

What changed

  • Resolve relative settings file paths against cwd when sandbox settings are merged in SubprocessCLITransport.
  • Add _resolve_settings_path() helper to centralize settings path resolution.
  • Add a regression test to verify that settings="settings.json" + cwd=<dir> + sandbox=... correctly loads and merges the settings file.

Why

When sandbox is provided, the SDK parses settings files itself before passing merged JSON to the CLI. Previously, relative settings paths were resolved from the process working directory instead of cwd, which could cause the SDK to miss valid settings files and drop existing settings unexpectedly.

Testing

  • pytest -q

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