mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 20:30:20 +00:00
fix(windows): reject unresolved cmd wrappers (#58436)
* fix(windows): reject unresolved cmd wrappers * fix(windows): add wrapper policy coverage * fix(windows): document wrapper fallback migration * fix(windows): drop changelog entry from pr * chore: add changelog for Windows wrapper fail-closed behavior --------- Co-authored-by: Devin Robison <drobison@nvidia.com> Co-authored-by: Devin Robison <drobison00@users.noreply.github.com>
This commit is contained in:
@@ -272,26 +272,21 @@ describe("resolveAcpClientSpawnInvocation", () => {
|
||||
expect(resolved.windowsHide).toBe(true);
|
||||
});
|
||||
|
||||
it("falls back to shell mode for unresolved wrappers on windows", async () => {
|
||||
it("fails closed for unresolved wrappers on windows", async () => {
|
||||
const dir = await createTempDir();
|
||||
const shimPath = path.join(dir, "openclaw.cmd");
|
||||
await writeFile(shimPath, "@ECHO off\r\necho wrapper\r\n", "utf8");
|
||||
|
||||
const resolved = resolveAcpClientSpawnInvocation(
|
||||
{ serverCommand: shimPath, serverArgs: ["acp"] },
|
||||
{
|
||||
platform: "win32",
|
||||
env: { PATH: dir, PATHEXT: ".CMD;.EXE;.BAT" },
|
||||
execPath: "C:\\node\\node.exe",
|
||||
},
|
||||
);
|
||||
|
||||
expect(resolved).toEqual({
|
||||
command: shimPath,
|
||||
args: ["acp"],
|
||||
shell: true,
|
||||
windowsHide: undefined,
|
||||
});
|
||||
expect(() =>
|
||||
resolveAcpClientSpawnInvocation(
|
||||
{ serverCommand: shimPath, serverArgs: ["acp"] },
|
||||
{
|
||||
platform: "win32",
|
||||
env: { PATH: dir, PATHEXT: ".CMD;.EXE;.BAT" },
|
||||
execPath: "C:\\node\\node.exe",
|
||||
},
|
||||
),
|
||||
).toThrow(/without shell execution/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -260,7 +260,6 @@ export function resolveAcpClientSpawnInvocation(
|
||||
env: runtime.env,
|
||||
execPath: runtime.execPath,
|
||||
packageName: "openclaw",
|
||||
allowShellFallback: true,
|
||||
});
|
||||
const resolved = materializeWindowsSpawnProgram(program, params.serverArgs);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user