Skip to content

Fix read-only metadata mount ordering for nested writable roots - #47623

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/45e439eaf537e10bfa8b839bad816b0401fb65aa
Sep 23, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/45e439eaf537e10bfa8b839bad816b0401fb65aa

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Fix read-only metadata mount ordering for nested writable roots

Why

Nested writable roots must allow the Linux sandbox to start while preserving read-only metadata protections, including when a writable directory sits beneath a read-only .codex directory.

What changed

Defer read-only subpath mounts shared with a deeper writable root until that root is bound. Keep symlink target remapping and writable-symlink validation for deferred paths so mount ordering does not bypass those checks.

Testing

Add regression coverage for mounting .git, .agents, and .codex metadata exactly once after the nested writable bind. Add sandbox integration cases for ordinary and symlinked roots, using both parent and nested working directories, to verify startup, allowed writes, metadata protection, and temporary mountpoint cleanup.

## Why

Nested writable roots must allow the Linux sandbox to start while preserving read-only metadata protections, including when a writable directory sits beneath a read-only `.codex` directory.

## What changed

Defer read-only subpath mounts shared with a deeper writable root until that root is bound. Keep symlink target remapping and writable-symlink validation for deferred paths so mount ordering does not bypass those checks.

## Testing

Add regression coverage for mounting `.git`, `.agents`, and `.codex` metadata exactly once after the nested writable bind. Add sandbox integration cases for ordinary and symlinked roots, using both parent and nested working directories, to verify startup, allowed writes, metadata protection, and temporary mountpoint cleanup.

GitOrigin-RevId: 45e439eaf537e10bfa8b839bad816b0401fb65aa
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/45e439eaf537e10bfa8b839bad816b0401fb65aa branch from ea53630 to 8bbe8f8 Compare September 23, 2026 18:51
@copyberry
copyberry Bot merged commit 8bbe8f8 into main Sep 23, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/45e439eaf537e10bfa8b839bad816b0401fb65aa branch September 23, 2026 18:51
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant