fix(qa): isolate parallels plugin temp script

This commit is contained in:
Vincent Koc 2026-06-23 12:33:59 +02:00
parent bd9f2a5e2e
commit 44d77de0c5
No known key found for this signature in database
2 changed files with 22 additions and 3 deletions

View file

@ -109,14 +109,17 @@ export function windowsProviderOnlyPluginIsolationScript(options: PluginIsolatio
return `$env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION = @'
${payloadJson}
'@
$isolationScriptPath = Join-Path ([System.IO.Path]::GetTempPath()) 'openclaw-parallels-plugin-isolation.cjs'
$isolationScriptPath = Join-Path ([System.IO.Path]::GetTempPath()) ('openclaw-parallels-plugin-isolation-' + [guid]::NewGuid().ToString('N') + '.cjs')
try {
@'
${providerOnlyPluginIsolationNodeSource()}
'@ | Set-Content -Path $isolationScriptPath -Encoding UTF8
node.exe $isolationScriptPath
if ($LASTEXITCODE -ne 0) { throw "plugin isolation failed with exit code $LASTEXITCODE" }
Remove-Item $isolationScriptPath -Force -ErrorAction SilentlyContinue
Remove-Item Env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION -Force -ErrorAction SilentlyContinue`;
} finally {
Remove-Item $isolationScriptPath -Force -ErrorAction SilentlyContinue
Remove-Item Env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION -Force -ErrorAction SilentlyContinue
}`;
}
function providerOnlyPluginIsolationNodeScript(options: PluginIsolationOptions): string {

View file

@ -58,6 +58,7 @@ import { testing as packageArtifactTesting } from "../../scripts/e2e/parallels/p
import { PhaseRunner } from "../../scripts/e2e/parallels/phase-runner.ts";
import {
posixCodexPlatformPackageRepairFunction,
windowsProviderOnlyPluginIsolationScript,
windowsCodexPlatformPackageRepairFunction,
} from "../../scripts/e2e/parallels/plugin-isolation.ts";
import { parseArgs as parseWindowsSmokeArgs } from "../../scripts/e2e/parallels/windows-smoke.ts";
@ -407,6 +408,21 @@ describe("Parallels smoke model selection", () => {
expect(windowsRepair).toContain("Repair-MissingCodexPlatformPackage");
});
it("keeps Windows provider-only plugin isolation temp scripts per run", () => {
const script = windowsProviderOnlyPluginIsolationScript({
fallbackPluginId: "openai",
modelId: "openai/gpt-5.5",
});
expect(script).toContain("[guid]::NewGuid().ToString('N')");
expect(script).toContain("openclaw-parallels-plugin-isolation-");
expect(script).not.toContain("'openclaw-parallels-plugin-isolation.cjs'");
expect(script).toContain("try {");
expect(script).toContain("} finally {");
expect(script).toContain("Remove-Item $isolationScriptPath -Force -ErrorAction SilentlyContinue");
expect(script).toContain("Remove-Item Env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION");
});
it("writes full model ids as config map keys in provider batches", () => {
const batch = JSON.parse(modelProviderConfigBatchJson("openai/gpt-5.5", "windows")) as Array<{
path: string;