From 890a053062b681caaef542537591a07e233aabae Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 00:05:40 +0100 Subject: [PATCH] test(release): strip BOM from Windows smoke config --- scripts/e2e/parallels/powershell.ts | 5 ++++- test/scripts/parallels-smoke-model.test.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/e2e/parallels/powershell.ts b/scripts/e2e/parallels/powershell.ts index cfb4cc4d282..06dd040d033 100644 --- a/scripts/e2e/parallels/powershell.ts +++ b/scripts/e2e/parallels/powershell.ts @@ -68,7 +68,10 @@ const fs = require("node:fs"); const path = require("node:path"); const configPath = process.env.OPENCLAW_PARALLELS_AGENT_CONFIG_PATH; const payload = JSON.parse(process.env.OPENCLAW_PARALLELS_AGENT_CONFIG_PATCH || "{}"); -const cfg = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, "utf8")) : {}; +function readJsonFile(filePath) { + return JSON.parse(fs.readFileSync(filePath, "utf8").replace(/^\\uFEFF/u, "")); +} +const cfg = fs.existsSync(configPath) ? readJsonFile(configPath) : {}; cfg.agents = cfg.agents && typeof cfg.agents === "object" ? cfg.agents : {}; cfg.agents.defaults = cfg.agents.defaults && typeof cfg.agents.defaults === "object" ? cfg.agents.defaults : {}; cfg.agents.defaults.skipBootstrap = true; diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index c3aca0bb4e3..33d6cb85b48 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -344,6 +344,7 @@ console.log(JSON.stringify(result)); expect(powershell).toContain("config set --batch-file"); expect(powershell).toContain("agents.defaults.skipBootstrap"); expect(powershell).toContain("tools.profile"); + expect(powershell).toContain("replace(/^\\\\uFEFF/u"); const npmUpdateScripts = readFileSync(TS_PATHS.npmUpdateScripts, "utf8"); expect(npmUpdateScripts).toContain("posixAgentWorkspaceScript");