Skip to content

Default agent TMPDIR to private sandbox storage - #11833

Merged
lpcox merged 2 commits into
mainfrom
copilot/agent-inherits-unwritable-tmpdir
Nov 19, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/agent-inherits-unwritable-tmpdir

Conversation

@lpcox

@lpcox lpcox commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

--env-all can forward a host TMPDIR that becomes unwritable inside the chroot, causing temp-file creation to fail with EACCES. Nested work-directory masks can trigger this by creating root-owned parent directories.

  • Sandbox default: Skip inherited TMPDIR and default to private /tmp after explicit environment values are merged.
  • Override compatibility: Preserve --env-file and --env choices; document that custom paths must be writable inside the sandbox.
  • Isolation unchanged: Retain host-side TMPDIR behavior, existing mounts, and secret masks.

@lpcox lpcox changed the title [WIP] Fix agent inheritance of unwritable host TMPDIR in chroot mode Default agent TMPDIR to private sandbox storage Nov 19, 2026
@lpcox
lpcox marked this pull request as ready for review November 19, 2026 16:59
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 16:59
@github-actions

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-11833 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 0a6f7ae

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.

🟢 Approval recommended

No active review issues are recorded for the change that defaults Compose agents’ TMPDIR to private /tmp.

No open issues 🎉

What changed in this PR

This PR addresses #11824 by defaulting Compose agents’ TMPDIR to private /tmp, avoiding failures caused by inherited host paths that are unwritable inside the sandbox.

Changes:

  • Skip host TMPDIR during --env-all forwarding and apply /tmp as the default after explicit overrides.
  • Add regression tests for defaults, nested work directories, and explicit override precedence.
  • Document custom-path requirements while preserving host-side temporary-file behavior and existing isolation.
File Description
src/​services/​agent-environment/​environment-builder.ts Default unset agent TMPDIR to /tmp.
src/​services/​agent-environment/​env-passthrough.ts Exclude inherited TMPDIR from host environment forwarding.
src/​services/​agent-environment-options.test.ts Cover defaults, host-path exclusion, isolation settings, and explicit overrides.
docs/​environment.md Explain sandbox defaults and requirements for custom temporary directories.

Review effort: Balanced (adaptive)

@lpcox
lpcox merged commit f36aeb9 into main Nov 19, 2026
42 of 45 checks passed
@lpcox
lpcox deleted the copilot/agent-inherits-unwritable-tmpdir branch November 19, 2026 18:44
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.

Agent inherits unwritable host TMPDIR under chroot (EACCES when AWF workDir lives in TMPDIR)

3 participants