fix: preserve native Modal directory snapshots with disjoint mounts - #4567
Open
Filimoa wants to merge 1 commit into
Open
fix: preserve native Modal directory snapshots with disjoint mounts#4567Filimoa wants to merge 1 commit into
Filimoa wants to merge 1 commit into
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.
Summary
This pull request fixes Modal
workspace_persistence="snapshot_directory"unnecessarily falling back to tar whenever any manifest mount cannot be detached, even when that mount is completely outside the directory being snapshotted.For example, a workspace rooted at
/workspacewith a Modal cloud-bucket mount at/mnt/remoteis a valid, disjoint topology. Modal's cloud-bucket strategy correctly reports that it cannot detach the mount, but the shared fallback check previously ignored the mount target and therefore downgradedSandbox.snapshot_directory("/workspace")to tar. Because the mount cannot be included in that directory snapshot, its detach capability is irrelevant.The fallback decision now accepts the resolved directory snapshot root and consults
supports_native_snapshot_detach()only for mounts whose normalized POSIX targets overlap that root. Equality, descendants, and ancestors are treated as overlap. Filesystem-wide snapshot callers continue to inspect every mount.The Modal adapter also preserves the no-copy boundary around mounted storage:
Test plan
uv run pytest -q tests/sandbox/test_session_utils.py tests/extensions/sandbox/test_modal.py(155 passed)..agents/skills/code-change-verification/scripts/run.shwith the Codex sandbox environment and a writable temporary uv cache; formatting, linting, type checking, and the full test suite passed.Issue number
N/A
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR