fix(server): run provider update commands through the shell on Windows
Provider update executables are package-manager launcher shims (`npm` ->
`npm.cmd`, `pnpm` -> `pnpm.cmd`, etc.). On Windows a bare-name spawn does
not resolve PATHEXT, so `ChildProcess.spawn("npm", ...)` fails with ENOENT,
surfaced to users as "Failed to run update command npm: NotFound". This
broke one-click updates for every npm/pnpm/bun/vp-managed provider on the
Windows backend.
Spawn the maintenance command with `shell: true` on win32 so the shell
resolves the shim, matching how every other provider command is already
spawned (ClaudeProvider, CodexSessionRuntime, CursorProvider, GrokProvider,
opencodeRuntime, AcpSessionRuntime). The update args are a fixed allowlist
of package names, so there is no shell-injection surface.
This commit is contained in:
1 parent
4cb3a5c1d4
commit
76bd75b9f0
1 file changed
+10
-1
@@ -76,7 +76,16 @@ const runProviderMaintenanceCommandWithSpawner = Effect.fn("ProviderMaintenanceR
|
||||
const collectCommandResult = Effect.fn("ProviderMaintenanceRunner.collectCommandResult")(
|
||||
function* () {
|
||||
const child = yield* input.spawner
|
||||
.spawn(ChildProcess.make(input.command, [...input.args]))
|
||||
.spawn(
|
||||
ChildProcess.make(input.command, [...input.args], {
|
||||
// The update executable is usually a launcher shim (e.g. `npm` ->
|
||||
// `npm.cmd`, `pnpm` -> `pnpm.cmd`). On Windows a bare-name spawn
|
||||
// does not resolve PATHEXT, so it fails with ENOENT; run through
|
||||
// the shell so the shim resolves, matching how every other
|
||||
// provider command is spawned on Windows.
|
||||
shell: process.platform === "win32",
|
||||
}),
|
||||
)
|
||||
.pipe(
|
||||
Effect.mapError(
|
||||
(cause) =>
|
||||
|
||||
Reference in new issue
Block a user