Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,6 @@ export default tseslint.config(
'when': 'hasNode',
'allow': [
'@github/copilot-sdk',
'@anthropic-ai/sandbox-runtime',
'@parcel/watcher',
'@vscode/sqlite3',
'@vscode/vscode-languagedetection',
Expand Down
10 changes: 0 additions & 10 deletions src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ import { NativeMcpDiscoveryHelperService } from '../../platform/mcp/node/nativeM
import { IMcpGatewayService, McpGatewayChannelName } from '../../platform/mcp/common/mcpGateway.js';
import { McpGatewayService } from '../../platform/mcp/node/mcpGatewayService.js';
import { McpGatewayChannel } from '../../platform/mcp/node/mcpGatewayChannel.js';
import { SandboxHelperChannelName } from '../../platform/sandbox/common/sandboxHelperIpc.js';
import { ISandboxHelperService } from '../../platform/sandbox/common/sandboxHelperService.js';
import { SandboxHelperService } from '../../platform/sandbox/node/sandboxHelperService.js';
import { IWebContentExtractorService } from '../../platform/webContentExtractor/common/webContentExtractor.js';
import { NativeWebContentExtractorService } from '../../platform/webContentExtractor/electron-main/webContentExtractorService.js';
import ErrorTelemetry from '../../platform/telemetry/electron-main/errorTelemetry.js';
Expand Down Expand Up @@ -1163,9 +1160,6 @@ export class CodeApplication extends Disposable {
// Proxy Auth
services.set(IProxyAuthService, new SyncDescriptor(ProxyAuthService));

// Sandbox
services.set(ISandboxHelperService, new SyncDescriptor(SandboxHelperService));

// MCP
services.set(INativeMcpDiscoveryHelperService, new SyncDescriptor(NativeMcpDiscoveryHelperService));
services.set(IMcpGatewayService, new SyncDescriptor(McpGatewayService));
Expand Down Expand Up @@ -1298,10 +1292,6 @@ export class CodeApplication extends Disposable {
const externalTerminalChannel = ProxyChannel.fromService(accessor.get(IExternalTerminalMainService), disposables);
mainProcessElectronServer.registerChannel('externalTerminal', externalTerminalChannel);

// Sandbox
const sandboxHelperChannel = ProxyChannel.fromService(accessor.get(ISandboxHelperService), disposables);
mainProcessElectronServer.registerChannel(SandboxHelperChannelName, sandboxHelperChannel);

// MCP
const mcpDiscoveryChannel = ProxyChannel.fromService(accessor.get(INativeMcpDiscoveryHelperService), disposables);
mainProcessElectronServer.registerChannel(NativeMcpDiscoveryHelperChannelName, mcpDiscoveryChannel);
Expand Down
13 changes: 0 additions & 13 deletions src/vs/platform/sandbox/common/sandboxErrorAnalysis.ts

This file was deleted.

45 changes: 0 additions & 45 deletions src/vs/platform/sandbox/common/sandboxHelperIpc.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/vs/platform/sandbox/common/sandboxHelperService.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/vs/platform/sandbox/electron-browser/sandboxHelperService.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/vs/platform/sandbox/node/sandboxHelperChannel.ts

This file was deleted.

131 changes: 0 additions & 131 deletions src/vs/platform/sandbox/node/sandboxHelperService.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/vs/server/node/serverServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ import { NativeMcpDiscoveryHelperService } from '../../platform/mcp/node/nativeM
import { IMcpGatewayService, McpGatewayChannelName } from '../../platform/mcp/common/mcpGateway.js';
import { McpGatewayService } from '../../platform/mcp/node/mcpGatewayService.js';
import { McpGatewayChannel } from '../../platform/mcp/node/mcpGatewayChannel.js';
import { SandboxHelperChannelName } from '../../platform/sandbox/common/sandboxHelperIpc.js';
import { ISandboxHelperService } from '../../platform/sandbox/common/sandboxHelperService.js';
import { SandboxHelperChannel } from '../../platform/sandbox/node/sandboxHelperChannel.js';
import { SandboxHelperService } from '../../platform/sandbox/node/sandboxHelperService.js';
import { IExtensionGalleryManifestService } from '../../platform/extensionManagement/common/extensionGalleryManifest.js';
import { ExtensionGalleryManifestIPCService } from '../../platform/extensionManagement/common/extensionGalleryManifestServiceIpc.js';
import { IAllowedMcpServersService, IMcpGalleryService, IMcpManagementService } from '../../platform/mcp/common/mcpManagement.js';
Expand Down Expand Up @@ -218,7 +214,6 @@ export async function setupServerServices(connectionToken: ServerConnectionToken
services.set(IExtensionSignatureVerificationService, new SyncDescriptor(ExtensionSignatureVerificationService));
services.set(IAllowedExtensionsService, new SyncDescriptor(AllowedExtensionsService));
services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
services.set(ISandboxHelperService, new SyncDescriptor(SandboxHelperService));
services.set(INativeMcpDiscoveryHelperService, new SyncDescriptor(NativeMcpDiscoveryHelperService));
services.set(IMcpGatewayService, new SyncDescriptor(McpGatewayService));

Expand Down Expand Up @@ -275,7 +270,6 @@ export async function setupServerServices(connectionToken: ServerConnectionToken
const remoteExtensionsScanner = new RemoteExtensionsScannerService(instantiationService.createInstance(ExtensionManagementCLI, productService.extensionsForceVersionByQuality ?? [], logService), environmentService, userDataProfilesService, extensionsScannerService, logService, extensionGalleryService, languagePackService, extensionManagementService);
socketServer.registerChannel(RemoteExtensionsScannerChannelName, new RemoteExtensionsScannerChannel(remoteExtensionsScanner, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));

socketServer.registerChannel(SandboxHelperChannelName, instantiationService.createInstance(SandboxHelperChannel));
socketServer.registerChannel(NativeMcpDiscoveryHelperChannelName, instantiationService.createInstance(NativeMcpDiscoveryHelperChannel, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
socketServer.registerChannel(McpGatewayChannelName, instantiationService.createInstance(McpGatewayChannel<RemoteAgentConnectionContext>, socketServer));

Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/contrib/mcp/common/mcpServerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { autorun, IObservable, observableValue } from '../../../../base/common/o
import { localize } from '../../../../nls.js';
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { ILogger, log, LogLevel } from '../../../../platform/log/common/log.js';
import { isSandboxFilesystemError } from '../../../../platform/sandbox/common/sandboxErrorAnalysis.js';
import { IMcpHostDelegate, IMcpMessageTransport } from './mcpRegistryTypes.js';
import { McpServerRequestHandler } from './mcpServerRequestHandler.js';
import { McpTaskManager } from './mcpTaskManager.js';
Expand Down Expand Up @@ -163,7 +162,7 @@ export class McpServerConnection extends Disposable implements IMcpServerConnect
};
}

if (isSandboxFilesystemError(message)) {
if (/(?:\b(?:EACCES|EPERM|ENOENT|EROFS|fail(?:ed|ure)?)\b|not accessible|read[- ]only)/i.test(message)) {
return {
kind: 'filesystem',
message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
import { registerMainProcessRemoteService } from '../../../../platform/ipc/electron-browser/services.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import '../../../../platform/sandbox/electron-browser/sandboxHelperService.js';
import { ILocalPtyService, TerminalIpcChannels } from '../../../../platform/terminal/common/terminal.js';
import { IWorkbenchContributionsRegistry, WorkbenchPhase, Extensions as WorkbenchExtensions, registerWorkbenchContribution2 } from '../../../common/contributions.js';
import { ITerminalProfileResolverService } from '../common/terminal.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ export class CommandLineSandboxRewriter extends Disposable implements ICommandLi
return undefined;
}

const wrappedCommand = await this._sandboxService.wrapCommand(options.commandLine);
if (wrappedCommand === options.commandLine) {
// If the sandbox service returns the same command, it means it didn't actually wrap it for some reason. In that case, we should return undefined to allow other rewriters to run, instead of returning a result that claims the command was rewritten but doesn't actually change anything.
// Ensure sandbox config is initialized before wrapping
const sandboxConfigPath = await this._sandboxService.getSandboxConfigPath();
if (!sandboxConfigPath) {
// If no sandbox config is available, run without sandboxing
return undefined;
}

const wrappedCommand = this._sandboxService.wrapCommand(options.commandLine);
return {
rewritten: wrappedCommand,
reasoning: 'Wrapped command for sandbox execution',
Expand Down
Loading
Loading