Skip to content

[WindowsSandboxing]: Updated env and commandline for executing commands using pwsh.exe#318466

Open
dileepyavan wants to merge 30 commits into
mainfrom
DileepY/mxc_fix
Open

[WindowsSandboxing]: Updated env and commandline for executing commands using pwsh.exe#318466
dileepyavan wants to merge 30 commits into
mainfrom
DileepY/mxc_fix

Conversation

@dileepyavan
Copy link
Copy Markdown
Member

This PR contains :

  • Updated mxc sdk npm package.
  • Env variables for powershell execution.
  • Update to command line property in sandboxing config.

This should improve command execution in windows sandboxing.

Copilot AI review requested due to automatic review settings May 26, 2026 23:48
@dileepyavan dileepyavan enabled auto-merge (squash) May 26, 2026 23:49
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented May 26, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@anthonykim1

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows MXC-based terminal sandboxing integration to improve command execution by updating the MXC SDK dependency, expanding the injected PowerShell-related environment variables, and adjusting the MXC config command line/cwd behavior.

Changes:

  • Bump @microsoft/mxc-sdk from 0.2.0 to 0.2.1 (root + remote).
  • Expand Windows MXC environment injection (SystemRoot, ComSpec, PATHEXT, PSModulePath, user profile paths, etc).
  • Update Windows MXC config generation (containment mode, pwsh.exe command wrapping, default cwd behavior) and add coverage for Windows symlink resolution.
Show a summary per file
File Description
test/sanity/src/context.ts Broadens the MXC SDK bin exclusion for VersionInfo validation.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts Updates Windows sandbox test env setup and asserts injected env vars/command line.
src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts Updates Windows MXC expectations, adds filesystem symlink resolution coverage, adjusts arm64/debug expectations.
src/vs/platform/sandbox/node/sandboxHelper.ts Injects additional Windows env vars needed for PowerShell execution (incl. LOCALAPPDATA).
src/vs/platform/sandbox/common/terminalSandboxMxcRuntime.ts Updates MXC config schema/fields and wraps commands via pwsh.exe, adds quoting helper.
src/vs/platform/sandbox/common/terminalSandboxEngine.ts Defaults Windows MXC cwd, resolves Windows realpaths via URI normalization helpers.
remote/package.json Bumps @microsoft/mxc-sdk to 0.2.1 (remote).
remote/package-lock.json Lockfile update for @microsoft/mxc-sdk@0.2.1 (remote).
package.json Bumps @microsoft/mxc-sdk to 0.2.1 (root).
package-lock.json Lockfile update for @microsoft/mxc-sdk@0.2.1 (root).

Copilot's findings

Files not reviewed (1)
  • remote/package-lock.json: Language not supported
  • Files reviewed: 8/10 changed files
  • Comments generated: 4

Comment thread src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts Outdated
Comment thread src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts Outdated
Comment thread src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts Outdated
roblourens
roblourens previously approved these changes May 27, 2026
anthonykim1 and others added 17 commits May 26, 2026 17:11
Gate Copilot CLI smoke test on existing env var
Chat: OTel enrichment for agent context
Mirrors the programmatic-export contract already supported by the
chat extension's github.copilot.chat.otel.exportAgentTracesDB
command: when callers pass a destination directory, the DB is
copied to <dir>/agent-host-traces.db with no save dialog. The
interactive (command palette) flow is unchanged.
Addresses review feedback: OTelSqliteStore opens the DB in WAL mode
and runs in a separate utility process, so a plain copy of the .db
file can miss uncheckpointed data still living in the -wal sidecar.

We can't safely issue 'wal_checkpoint' from the workbench process,
so instead copy the -wal and -shm sidecars alongside the main .db
when they exist. The resulting trio is a valid WAL-mode SQLite
database that any reader can open and checkpoint on demand.
chat: accept optional savePath arg for agentHost export action
…318096)

* feat: Implement changeset state caching and management in AgentHost

* Fixes

* fix: Update restoreSessionIfChangesetSubscription to return void and clarify handling of non-changeset URIs

* refactor: Simplify changeset eviction logic and improve comments for clarity

* feat: Add releaseBranchChanges method and enhance session summary change notifications
* Fix offline BYOK state management

Co-authored-by: Copilot <copilot@github.com>

* PR feedback

---------

Co-authored-by: Copilot <copilot@github.com>
* Decode image name for display in carousel

* Add test for percent-encoded carousel image names

Co-authored-by: kycutler <67761731+kycutler@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
) (#318228)

The provideAltTextQuickFix method calls document.lineAt(range.start.line)
without validating that the line number is within bounds. When the document
is modified between when VS Code computes the range and when the code action
provider executes, an out-of-bounds line number causes 'Illegal value for
`line`' to be thrown.

Add a bounds check before calling lineAt() so the method returns early
instead of throwing.

Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
) (#318229)

The memory leak fix in 1fc96f7 added cleanup of loggers on deregistration.
This created a race condition where IPC log messages from renderer processes
arrive after the logger has been removed from the map, causing an unhandled
error. Replace the throw with a silent return since log messages for a
removed logger are stale and should be discarded.

Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
[cherry-pick] Issue reporter wizard: dont include settings
Squashed cherry-pick of 10 commits from main that are included in the
Insiders build (183159e) people are verifying:

- agentHost: show fetched URL for web_fetch (#318240)
- Fix SSH remote agent host passphrase auth (#318244)
- agentHost: add setting to disable worktreeCreated task auto-dispatch (#318243)
- Agent host: clearer worktree git timeout errors and 60s budget (#318242)
- Normalize LF to CRLF in agent host terminal tool output (#318257)
- sessions: restore X-button removal of SSH remote agent host entries (#318262)
- chat: fix duplicate command registration for agent-host-copilotcli (#318273)
- launch: build copilot in compile; wait for CDP in launch.sh (#318272)
- Preserve unread state across remote host disconnect (#318267)
- Add more codenotify for terminal (#318285)
[cherry-pick] Disable walkthrough if ai features disabled on startup
vs-code-engineering Bot and others added 5 commits May 26, 2026 17:11
#316698) (#318405)

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
…accounts (#318427)

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
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.