Skip to content

agentHost: create Canvas data directory before sandboxed launch - #349930

Merged
Dileep Yavanmandha (dileepyavan) merged 2 commits into
mainfrom
DileepY/canvas-first-save
Nov 23, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 2 commits into
mainfrom
DileepY/canvas-first-save

Conversation

@dileepyavan

Copy link
Copy Markdown
Member

Fixes #348764. On a fresh Copilot home, the sandbox can write inside the granted extension-data directory but cannot create it in its protected parent. Create that directory on the host before SDK create or resume, only when the launch policy grants it. No sandbox permissions are broadened.

Adds launcher regression tests for first save and withheld access on create and resume. On the main-based port, the diff check and an isolated filesystem check passed. The launcher tests and client type-check could not run on this revision because dependency restore returned HTTP 404 for the pinned SDK. The live macOS sandbox was not retested.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 19:16
@dileepyavan Dileep Yavanmandha (dileepyavan) added the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Nov 23, 2026

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

The Canvas grant tests still use /copilot-home, so real directory creation can fail on unprivileged runners or leave persistent state; the fixtures need a shared temporary home and teardown cleanup.

1 open issue
What changed in this PR

Addresses #348764 by creating Canvas storage before sandboxed Copilot SDK create or resume, allowing first saves on a fresh Copilot home without broadening sandbox permissions.

Changes:

  • Creates extension-data only when Canvas is enabled and the launch configuration grants write access.
  • Shares the directory-path helper and allows tests to supply a Copilot home.
  • Adds create/resume regression tests for granted and withheld access, and documents the behavior.
File Description
src/​vs/​workbench/​contrib/​sessions/​providers/​agentHost/​AGENT_HOST_SESSIONS_PROVIDER.md Documents host-side storage preparation.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncherTestHelpers.ts Adds a configurable test Copilot home.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Adds first-save and withheld-access regression tests.
src/​vs/​platform/​agentHost/​node/​copilot/​sandboxConfigForSdk.ts Exposes a shared extension-data path helper.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Creates granted Canvas storage before SDK opening.

Review effort: Balanced

Merged via the queue into main with commit 02b4308 Nov 23, 2026
38 checks passed
@dileepyavan
Dileep Yavanmandha (dileepyavan) deleted the DileepY/canvas-first-save branch November 23, 2026 21:58
Dileep Yavanmandha (dileepyavan) added a commit that referenced this pull request Nov 24, 2026
…349930) (#350017)

[release/1.148] agentHost: prepare Canvas data directory (#349930)

Backport #349930 to release/1.148.

(cherry picked from commit 02b4308)

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sandbox blocks canvas extension from writing its private state

4 participants