fix(sandbox): bootstrap Docker workspace before removal binding - #5210
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. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed da58713dda7164297dc3abfac8c250ffaaabbea7. The shared creation path applies the workspace setting to initial creation and replacement resume; I found no introduced runtime defect in binding or rollback. Two test issues remain: isolate the new client-lifecycle coverage, and remove its dependence on the host temporary-directory mount layout.
All 22 hosted checks passed on this commit. Validation here was source inspection plus hosted CI; I did not run repository tests or privileged Docker integration.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e33adca29f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dd45a80d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
markstuart-oai
left a comment
There was a problem hiding this comment.
Re-reviewed at 3dd45a8. The focused client-lifecycle module, shared fixture, and container-root device model address my earlier findings. Running bootstrap as the trusted image’s default user also preserves the existing permission contract; the cleanup and replacement-state restoration paths look consistent.
One P2 remains: bootstrap now executes before removal-service eligibility checks, so a rejected writable host mount can still be modified through an image symlink. I left an inline example and a suggestion to keep this ordering inside the existing binding lifecycle.
Validation: source review, including an independent runtime pass, and all 22 hosted checks passing on this head. I did not run repository tests or a Docker reproduction locally.
markstuart-oai
left a comment
There was a problem hiding this comment.
Re-reviewed 2aecd28da5c3c2e9595609f9488adc0ce2c04ad5 against ec8e8362cbd7b81e81bc3fd338effc7c3045051e, including the changes since my previous review. The eligibility-before-bootstrap issue is fixed, and no new actionable findings remain after my source review and an independent lifecycle pass.
Workspace creation now runs within the removal service after the closed/duplicate, writable-grant, mount-authority and container-eligibility checks, while strict paused canonical binding still follows creation. I checked fresh creation, replacement resume, the unchanged live-resume/direct-binding paths, and failure cleanup/rollback. The focused regressions check untouched host contents and no bootstrap execution for both writable host grants and image volumes. The earlier test-module and simulated root-device fixes remain intact.
All 22 hosted checks on this exact head passed, including supported Python test jobs, Windows/packaged contracts, container checks, lint and typechecks. This was source-only validation; I did not run local tests, Docker workloads or builds. Prior review threads are resolved.
Summary
This pull request fixes Docker sandbox creation with
DockerRemovalServicewhen the image does not already contain the workspace directory. Fresh creation and replacement-container resume first reject unsupported removal-service configurations, then create the workspace with the trusted image's default user before strict removal-authority binding, preserving normal write permissions for non-root images.Existing contents and ownership are preserved. Workspace parents are created as needed; unrelated missing grant roots still fail binding. Strict canonicalization, private-filesystem checks, grant boundaries, and root-removal protection remain in place. Failed bootstrap cleans up the acquired container and restores replacement-resume state. Writable host grants and unsupported actual mounts are rejected before bootstrap can follow image symlinks into shared storage. Direct service binding retains its existing pre-created-root and paused-container behavior.
Test plan
/tmpdevice.Checks
.agents/skills/code-change-verification/scripts/run.shon the final update