Skip to content

fix: prepare sensitive tmpfs targets in read-only handoffs - #11812

Merged
rabeckett merged 2 commits into
fix/private-tmp-ci-fixturesfrom
fix/11811-clean-handoff-masks
Nov 19, 2026
Merged

rabeckett merged 2 commits into
fix/private-tmp-ci-fixturesfrom
fix/11811-clean-handoff-masks

Conversation

@rabeckett

@rabeckett rabeckett commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

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's mkdirat ... read-only file system with 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.

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]>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 02:35
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11812 artifact from the workflow run
  2. Unzip and open index.html in your browser

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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread src/compose-generator.ts
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
rabeckett merged commit ef6bca0 into fix/private-tmp-ci-fixtures Nov 19, 2026
11 of 12 checks passed
@rabeckett
rabeckett deleted the fix/11811-clean-handoff-masks branch November 19, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants