mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #314] [MERGED] fix(sidecar): preserve Windows PATH key casing to prevent CUDA backend failure #4556
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4556
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/314
Author: @Lochalan
Created: 4/29/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @LukaTheHero
Base:
main← Head:main📝 Commits (1)
2caf45ffix(sidecar): preserve Windows PATH key casing to prevent CUDA backend failure📊 Changes
2 files changed (+25 additions, -2 deletions)
View changed files
📝
packages/server/src/services/sidecar/sidecar-runtime-env.ts(+8 -2)📝
packages/server/test/sidecar-runtime-env.test.ts(+17 -0)📄 Description
Closes #315
Why this change
On Windows,
buildLlamaProcessEnvinsidecar-runtime-env.tsspreadsprocess.envinto a plain object. Whileprocess.envitself is a case-insensitive Proxy, the spread result is a plain object that preserves the native key casing — typically"Path"(title-case), not"PATH".The original code writes to
env.PATH, which creates a duplicate key when the existing key is"Path". The short uppercasePATH(containing only the runtime directory) takes precedence, stripping the child process of all system directories — includingC:\Windows\System32and NVIDIA driver paths.This prevents
ggml-cuda.dllfrom resolving its implicit dependencies (nvcuda.dll,cublas64_*.dll), causing silent CUDA load failure and automatic CPU fallback on every startup.Before fix (old runtime b8851 without bundled CUDA DLLs)
Controlled A/B test — same machine, same session
What changed
sidecar-runtime-env.ts: UseObject.keys(env).find(k => k.toLowerCase() === "path")to detect the actual key casing before prepending. Falls back to"PATH"if no key exists.sidecar-runtime-env.test.ts: Added regression test verifying that a"Path"key is modified in-place without creating a duplicate"PATH"key.Compatibility
This fix is complementary to #270 (bundling CUDA DLLs). With bundled DLLs, the CUDA symptom is masked because DLLs are found via same-directory resolution. However, the child process still loses its entire system PATH, which could affect other functionality. This fix addresses the root cause.
Validation
pnpm checkllama-server --versionwith old vs new env constructionSummary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.