From f063b42ea4ff1f3551a451fc18704e8ce02f3b24 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 12 Mar 2026 10:04:33 -0700 Subject: [PATCH] Agenthost server fixes --- scripts/code-agent-host.js | 2 +- src/vs/platform/agentHost/node/agentHostServerMain.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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';