Skip to content

fix(auggie): resolve spawn EINVAL when running the CLI shim on Windowsfix(auggie): resolve spawn EINVAL when running the CLI shim on Windows - #14215

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
andreyzagid-tech:fix/auggie-win32-initmodels
Sep 22, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
andreyzagid-tech:fix/auggie-win32-initmodels

Conversation

@andreyzagid-tech

Copy link
Copy Markdown
Contributor

Problem

On Windows, auggie requests fail with [502]: spawn EINVAL. Since Node's CVE-2024-27980 fix (>=18.20.2 / 20.12.2 / 21.7.3), spawn() on a .cmd/.bat shim without shell: true throws spawn EINVAL synchronously.

#6304 fixed the two request-time spawn sites (spawnAuggie/runStreaming) by routing them through the shared buildAuggieSpawnOptions() helper, which sets shell: true on win32. But two other CLI spawn sites were left bypassing it:

  • initAuggieModels() — auggie model list
  • checkAuggieCliVersion() — auggie --version

Both still threw spawn EINVAL on win32, so provider discovery and version checks kept failing even after #6304.

Fix

  • Generalize buildAuggieSpawnOptions<S extends readonly string[]>(stdio) so any stdio layout can be routed through it, and add windowsHide: true.
  • Route initAuggieModels and checkAuggieCliVersion through buildAuggieSpawnOptions (shell enabled on win32).

Test

New tests/unit/auggie-win32-spawn-init-models-and-version.test.ts (Windows-only, skip: !isWin32) uses real .cmd batch shims and spawns end-to-end:

  • checkAuggieCliVersion runs a .cmd shim → fails with spawn EINVAL before this fix, passes after
  • initAuggieModels discovers models from a .cmd shim → same before/after

Verified: new test 2/2 ✅, existing auggie-win32-spawn-6304 3/3 ✅, tsc --pretty false -p tsconfig.typecheck-core.json ✅, eslint ✅.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @andreyzagid-tech — merging via the release merge-train. Validated in local merge-train (mt-train10c) on the devbox @ train tip 4d841aa1c740bbaa03868dc0a403c62099a99a42 with the 72 sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 831/831 (0 failing) and vitest 480/482 — the two reds are autoCombo/provider-family-combos.test.ts timing out at 20s, which reproduces on the PURE release tip under the full vitest suite (and is already tracked by the Release-Green issue #13866), so it is inherited, not this batch's. Merged --admin per merge-gates §3/§4/§7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants