[TerminalSandboxing]:Fixing issues with macOS #302288
Draft
dileepyavan wants to merge 11 commits intomainfrom
Draft
[TerminalSandboxing]:Fixing issues with macOS #302288dileepyavan wants to merge 11 commits intomainfrom
dileepyavan wants to merge 11 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the terminal sandboxing flow used by chat agent terminal tools, adding extra metadata to track when commands are sandbox-wrapped and enhancing sandbox initialization to pass temp dir and ripgrep details through the sandbox helper.
Changes:
- Add
isSandboxWrappedmetadata through command-line rewriters into terminal tool invocation data for improved messaging/telemetry. - Update sandbox helper IPC/service APIs to accept optional environment-prefix details when wrapping commands.
- Extend
TerminalSandboxServiceto resolve runtime paths (ripgrep) and temp dir for sandbox execution.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/sandboxedCommandLinePresenter.test.ts | Updates test stub to satisfy new sandbox service interface shape. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts | Adds temp dir + ripgrep runtime config resolution and hooks sandbox reset to config/trusted-domain changes. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts | Threads isSandboxWrapped through tool data and adjusts user-facing result notes. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.ts | Marks sandbox rewrite results with isSandboxWrapped: true. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.ts | Extends rewriter result contract with isSandboxWrapped?: boolean. |
| src/vs/workbench/contrib/chat/common/chatService/chatService.ts | Extends terminal invocation data schema to include isSandboxWrapped. |
| src/vs/platform/sandbox/node/sandboxHelperService.ts | Adds optional env prefix handling and refactors sandbox init/wrap separation. |
| src/vs/platform/sandbox/node/sandboxHelperChannel.ts | Wires new optional argument across IPC for wrapWithSandbox. |
| src/vs/platform/sandbox/common/sandboxHelperService.ts | Updates service interface signature for wrapWithSandbox(..., envDetails?). |
You can also share your feedback on Copilot code review. Take the survey.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts
Show resolved
Hide resolved
Comment on lines
+174
to
+178
| // Quote shell arguments so the wrapped command cannot break out of the outer shell. | ||
| let envDetails = `TMPDIR="${this._tempDir.path}"`; | ||
| if (!this._remoteEnvDetails) { | ||
| envDetails = `ELECTRON_RUN_AS_NODE=1 ${envDetails}`; | ||
| } |
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes the below changes: