Repository navigation
Fix: support VAR=value env prefixes in agent command override #5363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
carlosbaraza
wants to merge
2
commits into
stablyai:main
from
carlosbaraza:fix/agent-command-override-env-prefix
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Node.js child_process.spawn on Windows, how are duplicate environment keys that differ only by case (e.g., PATH vs Path) handled, and which value wins?💡 Result:
In Node.js, when using child_process.spawn on Windows, duplicate environment keys that differ only by case are handled by a sanitization process that removes the duplicates [1]. Specifically, Node.js sorts the environment keys lexicographically and filters them so that only one entry remains for each case-insensitive key [1]. When multiple variants of a key exist (e.g., PATH and Path), the entry that comes first in lexicographic order (based on the original key string) is the one that is kept and passed to the spawned subprocess [2][1]. This behavior was implemented to address issues where certain applications or system processes become confused by the presence of duplicate environment variables on Windows, which natively treats environment variable names as case-insensitive [1]. Consequently, if you provide an environment object to spawn, you should ensure that only the desired version of any case-variant key is included, or be aware that the lexicographically first variant will effectively win [2][3].
Citations:
🏁 Script executed:
Repository: stablyai/orca
Length of output: 118
🏁 Script executed:
Repository: stablyai/orca
Length of output: 2409
🏁 Script executed:
Repository: stablyai/orca
Length of output: 208
🏁 Script executed:
Repository: stablyai/orca
Length of output: 6881
Normalize
PATH/Pathenvironment key on Windows when mergingplan.env.These merges can result in both
PATHandPathkeys in the spawned environment. Node.js spawn on Windows sanitizes environment variables and keeps the lexicographically first key;PATHwill win, causing anyPathoverride to be silently ignored during process spawning.Also applies to: 495-497