[GH-ISSUE #315] Sidecar child process loses system PATH on Windows due to env key casing #130

Closed
opened 2026-10-20 17:25:29 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Lochalan on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/315

Originally assigned to: @LukaTheHero on GitHub.

On Windows, buildLlamaProcessEnv spreads process.env into a plain object, then writes to env.PATH.
Windows natively stores the key as "Path" (title-case). While process.env is a case-insensitive Proxy, the spread result is a regular case-sensitive object. Writing to env.PATH creates a duplicate key, causing the child process to inherit only the runtime directory instead of the full system PATH.
This strips NVIDIA driver paths and C:\Windows\System32, preventing ggml-cuda.dll from resolving dependencies like nvcuda.dll and cublas64_*.dll, causing silent CUDA failure and automatic CPU fallback.
Affected file: packages/server/src/services/sidecar/sidecar-runtime-env.ts line 32.

Image
Originally created by @Lochalan on GitHub (Apr 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/315 Originally assigned to: @LukaTheHero on GitHub. On Windows, `buildLlamaProcessEnv` spreads `process.env` into a plain object, then writes to `env.PATH`. Windows natively stores the key as `"Path"` (title-case). While `process.env` is a case-insensitive Proxy, the spread result is a regular case-sensitive object. Writing to `env.PATH` creates a duplicate key, causing the child process to inherit only the runtime directory instead of the full system PATH. This strips NVIDIA driver paths and `C:\Windows\System32`, preventing `ggml-cuda.dll` from resolving dependencies like `nvcuda.dll` and `cublas64_*.dll`, causing silent CUDA failure and automatic CPU fallback. Affected file: `packages/server/src/services/sidecar/sidecar-runtime-env.ts` line 32. <img width="1445" height="549" alt="Image" src="https://github.com/user-attachments/assets/763b8996-4e3b-4193-83b7-d7368a25ff1f" />
Author
Owner

@LukaTheHero commented on GitHub (May 3, 2026):

Merged your PR, thanks for the contribution!

<!-- gh-comment-id:4366058887 --> @LukaTheHero commented on GitHub (May 3, 2026): Merged your PR, thanks for the contribution!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#130
No description provided.