fix: ignore relative snapshot base overrides#2976
Conversation
Only accept absolute environment overrides for the default local snapshot base directory so snapshot storage does not become cwd-dependent. Add regression coverage for relative XDG and Windows env paths.
seratch
left a comment
There was a problem hiding this comment.
One small concern before merging: the direction looks right, but the Windows-specific coverage is still a bit indirect.
The new tests exercise the os_name="nt" branch, but they use POSIX-style absolute paths from tmp_path. That means we are not actually proving that a Windows-style env value such as C:\Users\me\AppData\Local is treated as absolute when platform/os_name are injected for a simulated Windows case.
If platform / os_name injection is intended to support cross-platform unit tests, we may want either:
- a test that covers Windows-style absolute env paths explicitly, or
- branch-specific path handling using
PureWindowsPathfor the Windows env vars.
Not blocking from my side, but I think this would make the regression coverage more precise.
|
Yes, that makes sense. I updated the I also added coverage for |
Summary
XDG_STATE_HOME,LOCALAPPDATA, andAPPDATAoverridesTesting
uv run pytest -s tests/sandbox/test_snapshot_defaults.pyuv run ruff check src/agents/sandbox/snapshot_defaults.py tests/sandbox/test_snapshot_defaults.pySigned-off-by: matthewflint 277024436+matthewflint@users.noreply.github.com