Repository navigation
fix: prepare sensitive tmpfs targets in read-only handoffs - #11812
Merged
rabeckett merged 2 commits intoNov 19, 2026
Merged
Conversation
Use the final bind topology for the normal and chroot handoff. Pre-create missing directory mountpoints on the runner before Docker installs the read-only parent, preserving existing contents, owners, modes and guest masks. Refs #11811 Co-authored-by: Copilot <[email protected]>
Contributor
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit e7a175d |
Validate a pre-staged read-only override without creating paths in its host source. Test both independent guest views, translated sources, and the empty custom-source refusal. Refs #11811 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Compose tests now write to the real /tmp/gh-aw outside their fixtures, causing host-dependent failures, and previously valid handoff mounts with trailing slashes now abort.
3 open issues
What changed in this PR
Updates Compose startup to prepare sensitive tmpfs mountpoints in read-only handoffs, addressing clean-run failures without broadening guest access.
Changes:
- Passes sensitive tmpfs targets into mountpoint preparation.
- Creates missing handoff directories while preserving existing contents and permissions.
- Adds focused regression coverage and documents first-run behavior.
| File | Description |
|---|---|
src/services/gemini-settings-service.test.ts |
Updates mount-preparation expectations. |
src/services/agent-volumes/nested-mountpoints.ts |
Prepares sensitive directory targets using runner-side sources. |
src/services/agent-volumes/nested-mountpoints.test.ts |
Covers directory creation, preservation, and invalid ancestors. |
src/compose-generator.ts |
Forwards sensitive tmpfs targets to preparation. |
docs/mount-policy.md |
Explains startup behavior for cleaned handoffs. |
Review effort: Max (adaptive)
| rootOwnedTargets: [`/host${GEMINI_CLI_SYSTEM_SETTINGS_DIRECTORY}`], | ||
| } : undefined, | ||
| nestedMountpointOptions: { | ||
| sensitiveTmpfs: runtimeUsesComposeAgent(config.containerRuntime) ? dockerSensitiveTmpfs(config.workDir) : [], |
| fs.realpathSync(target) === path.join(fs.realpathSync(root), relative)) return false; | ||
| throw new Error(`Create the directory ${target} for the read-only handoff before starting Docker`); | ||
| } | ||
| let fd = openArtifactDirectory(root); |
| expect(() => ensureNestedMountpoints([`${tmpRoot}:/tmp/gh-aw:ro`], 0, 0, undefined, masks)) | ||
| .toThrow(/ENOTDIR/); | ||
| expect(fs.readFileSync(path.join(tmpRoot, 'sandbox'), 'utf8')).toBe('keep'); | ||
| }); |
rabeckett
merged commit Nov 19, 2026
ef6bca0
into
fix/private-tmp-ci-fixtures
11 of 12 checks passed
This was referenced Nov 19, 2026
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.



Fixes #11811. This change targets the branch of #11809 so the two independent fixes can reach the same tested head without asking one PR to pass
main's other broken required gate first.#11748 made integration cleanup remove the previous run's handoff. This exposed a runtime dependency on leftover directories: Docker cannot create a sensitive tmpfs mountpoint after its covering handoff has been mounted read-only. Reverting cleanup or removing a mask would hide the failure rather than fix startup.
Compose now passes its sensitive tmpfs list to mountpoint preparation. On Linux, only missing directory targets in the canonical runner handoff are created. Both guest views use the final bind topology. A custom read-only source must already contain the directories; otherwise startup reports the missing target and leaves the source untouched. Existing directory modes and contents are left alone. There is no new bind, writable guest path, credential placeholder file, or change to the integration assertions.
On the reviewed head,
ef6bca01e4f0, 91 focused Linux tests, TypeScript, the build and targeted ESLint passed. The previous head also passed the full lint and schema-parity checks. An empty bind reproduced runc'smkdirat ... read-only file systemwith exit 125 before the change. With the patched code, the same network-disabled Docker setup started, both binds were read-only, all six sensitive paths were independent tmpfs mounts, existing host markers were hidden, and writes under the masks did not reach the host. The full integration harness was not run on the shared local daemon.