diff --git a/scripts/code-agent-host.js b/scripts/code-agent-host.js index f91eda13784..c618870e396 100644 --- a/scripts/code-agent-host.js +++ b/scripts/code-agent-host.js @@ -41,7 +41,7 @@ function startServer(programArgs) { 'out', 'vs', 'platform', - 'agent', + 'agentHost', 'node', 'agentHostServerMain.js', ); diff --git a/src/vs/platform/agentHost/node/agentHostServerMain.ts b/src/vs/platform/agentHost/node/agentHostServerMain.ts index a265d4a9dc4..c3aa5180481 100644 --- a/src/vs/platform/agentHost/node/agentHostServerMain.ts +++ b/src/vs/platform/agentHost/node/agentHostServerMain.ts @@ -6,6 +6,13 @@ // Standalone agent host server with WebSocket protocol transport. // Start with: node out/vs/platform/agentHost/node/agentHostServerMain.js [--port ] [--enable-mock-agent] +import { fileURLToPath } from 'url'; + +// This standalone process isn't bootstrapped via bootstrap-esm.ts, so we must +// set _VSCODE_FILE_ROOT ourselves so that FileAccess can resolve module paths. +// This file lives at out/vs/platform/agentHost/node/ - the root is `out/`. +globalThis._VSCODE_FILE_ROOT = fileURLToPath(new URL('../../../..', import.meta.url)); + import { DisposableStore } from '../../../base/common/lifecycle.js'; import { URI } from '../../../base/common/uri.js'; import { localize } from '../../../nls.js';