fix(sandbox): preserve UnixLocal hardlink snapshots and validate before clearing - #5188
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
seratch
left a comment
There was a problem hiding this comment.
LGTM; can you resolve the conflicts?
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed 5cbdaa1c91babdcd2b5ad092a866efb75fed2524; no findings. Each retained hardlinked path gets its own regular-file payload, including when the first path is excluded, while symlinks retain their existing handling. Resume reuses the strict archive validator before clearing the workspace, and cancellation retains archive ownership until validation finishes.
The public-session regressions cover the relevant round trips and invalid-archive preservation. All 22 hosted checks passed on this commit. This was a source review; I did not rerun the reported local suites. The merge-conflict refresh mentioned in Slack has not been pushed as of this review and is not covered by it.
Summary
This pull request fixes UnixLocal snapshot round trips when workspace files share an inode. Each retained hardlinked path is archived with its own regular-file payload, including when the first path is excluded from persistence. Existing symlink handling and strict extraction safeguards are preserved.
UnixLocal resume now validates the restored archive before clearing the live workspace. Older incompatible snapshots fail without deleting current files. This prevents the reported validation-time data loss; it does not add rollback for later extraction I/O failures or recover payloads missing from older snapshots.
Test plan
Issue number
Fixes #5180
Checks
.agents/skills/code-change-verification/scripts/run.sh