From be42dbc2ca2d68b375dee254a0eb812c215bedce Mon Sep 17 00:00:00 2001 From: Stefan Hoelzl <1478183+stefanhoelzl@users.noreply.github.com> Date: Tue, 29 Sep 2026 17:02:07 +0200 Subject: [PATCH] fix(e2e): give Claude a long-path config dir so the IDE server cannot abort On Windows runners os.tmpdir() is an 8.3 short path (C:\Users\RUNNER~1\...). The mock's CLAUDE_CONFIG_DIR inherited it, and the Claude extension, which Claude installs into the IDE server mid-test, watches that folder from the server process. libuv before 1.53.0 asserts on the first event in a short-path watched directory (libuv#5010), so the whole IDE server aborted and agent-turn failed with "No Claude session is running". Co-Authored-By: Claude Opus 5.5 --- e2e/agent-mock.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/e2e/agent-mock.ts b/e2e/agent-mock.ts index f75e23ec..caf30492 100644 --- a/e2e/agent-mock.ts +++ b/e2e/agent-mock.ts @@ -19,7 +19,15 @@ */ import { getTextContent, LLMock, type ChatCompletionRequest } from "@copilotkit/aimock"; import { test } from "@playwright/test"; -import { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { + existsSync, + mkdtempSync, + readdirSync, + readFileSync, + realpathSync, + rmSync, + writeFileSync, +} from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import type { Agent } from "./env.ts"; @@ -124,7 +132,12 @@ export function useAgentMock(options: AgentMockOptions = {}): AgentMockHandle { test.beforeAll(async () => { const agent = test.info().project.name as Agent; - configDir = mkdtempSync(join(tmpdir(), "ch-e2e-agent-")); + // The long form: Windows runners' temp dir is an 8.3 short path + // (C:\Users\RUNNER~1\...), and this becomes CLAUDE_CONFIG_DIR, which the + // Claude extension watches from inside the IDE server. libuv before 1.53.0 + // aborts the whole server on the first event in a short-path watched + // directory (libuv#5010). Only `.native` expands short names. + configDir = realpathSync.native(mkdtempSync(join(tmpdir(), "ch-e2e-agent-"))); // port 0: the suite already picks a free port for the IDE server rather than // colliding with a developer's running instance, and a mock is no different.