Skip to content

[release/1.148] agentHost: prepare Canvas data directory (cherry-pick #349930) - #350017

Merged
Dileep Yavanmandha (dileepyavan) merged 1 commit into
release/1.148from
DileepY/cherry-pick-349930-1.148
Nov 24, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 1 commit into
release/1.148from
DileepY/cherry-pick-349930-1.148

Conversation

@dileepyavan

Copy link
Copy Markdown
Member

Backports #349930 to release/1.148. Refs #348764.

Creates the Canvas extension-data directory on the host before SDK create or resume, only when extensions and sandboxing are enabled and the launch policy grants that exact directory. This fixes first-save failures on a fresh Copilot home without broadening sandbox permissions. Includes launcher regression tests and the original documentation update.

Cherry-picked merged commit 02b430888f144baf673ed898f6457139cf0e7fda without code changes or conflicts. Independently based on release/1.148 at dec73890cb0bc7fd437520dbc7e74c55df259cd3.

Validation

  • git diff --cached --check: passed before commit.
  • git patch-id --stable on the source commit and backport: identical.
  • npm run -s precommit: passed; hygiene checked all 5 changed files and oxlint checked 4 TypeScript files. Commit signing remained enabled.
  • npm run compile-client: blocked by missing @microsoft/copilot-sdk.
  • Full dependency restoration via pnpm install --frozen-lockfile on the identical release dependency manifests failed with HTTP 404 for @microsoft/[email protected]. Locked development/build tooling was restored separately so commit hooks could run.
  • Unit tests and live sandbox verification: not run because compilation/runtime dependency restoration is blocked.

How to test

After dependencies and compilation are available, run:

.\scripts\test.bat --run src\vs\platform\agentHost\test\node\copilotSessionLauncher.test.ts --grep "sandbox policy|canvas config"

With a fresh Copilot home, start or resume a sandboxed session with Canvas enabled and save Canvas state. Confirm the granted extension-data directory exists before the SDK opens, and withheld access does not create it.

Backport #349930 to release/1.148.

(cherry picked from commit 02b4308)

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 23:34

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.

🔵 Needs a closer look

The sandbox-boundary backport needs maintainer runtime validation because blocked restoration of the pinned SDK leaves launcher tests and live macOS sandbox verification unrun.

No open issues 🎉

What changed in this PR

Backports #349930 to release/1.148 to address Canvas first-save failures in sandboxed Agent Host sessions. The host prepares the Canvas data directory before SDK create or resume, without broadening sandbox permissions.

Changes:

  • Create the directory only when extensions and sandboxing are enabled and the launch policy grants the exact path.
  • Share directory-path construction between sandbox configuration and session launch.
  • Add create/resume regression coverage and document directory preparation.

No actionable findings remain. Launcher tests and live sandbox verification remain pending because of the reported SDK dependency blocker.

File Description
src/​vs/​workbench/​contrib/​sessions/​providers/​agentHost/​AGENT_HOST_SESSIONS_PROVIDER.md Documents directory preparation before SDK create or resume.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncherTestHelpers.ts Allows tests to supply an isolated Copilot home.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Covers granted and withheld directory preparation for create and resume.
src/​vs/​platform/​agentHost/​node/​copilot/​sandboxConfigForSdk.ts Extracts the shared Canvas data-directory helper.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Creates the explicitly granted directory before opening the SDK session.

Review effort: Balanced

@dileepyavan
Dileep Yavanmandha (dileepyavan) merged commit 46796f4 into release/1.148 Nov 24, 2026
52 checks passed
@dileepyavan
Dileep Yavanmandha (dileepyavan) deleted the DileepY/cherry-pick-349930-1.148 branch November 24, 2026 02:12
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.

4 participants