Repository navigation
fix(cli): probe Windows .cmd/.bat shims through cmd.exe so the tool detector no longer triggers DEP0190 - #17021
Merged
diegosouzapw merged 2 commits intoOct 18, 2026
Conversation
…etector no longer triggers DEP0190
diegosouzapw
merged commit Oct 18, 2026
1d76655
into
cheaper-inference:release/v3.8.52
44 of 60 checks passed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
omniroute doctor,statusandconfigprint Node 24's[DEP0190] DeprecationWarning: Passing args to a child process with shell option true…. This change makes the CLI tool detector probe.cmd/.batshims without that pattern, so the warning goes away. Detection results are unchanged, except that a shim whose path contains spaces now reports its version: before, theshell: truecommand line was unquoted and the probe failed, so onlyinstalled: truewas reported (from cmd's documented quoting rules; not run on Windows).detectBinaryWindowsinsrc/lib/cli-helper/tool-detector.tsran the--versionprobe asexecFile(shimPath, ["--version"], { shell: true, windowsVerbatimArguments: true }), which isshell: truewith a non-empty argument array, the exact shape DEP0190 deprecates. fix(cli): spawn npm without DEP0190 on win32 — pass a joined command line instead of an argv array #15328 fixed the npm path inbin/cli/npm-exec.mjsbut not this one, as discussed in Node warning after upgrading to v3.8.51 #15315.Related Issues
shell: truewith a non-empty argument array on Windows).Target Branch
release/v3.8.xbranch (the highest openrelease/v*, hererelease/v3.8.52), notmainProof Of Fix (required)
tests/unit/cli-helper/tool-detector-win32-7279.test.ts, new case "probes a .cmd shim through cmd.exe without shell: true plus an argument array (DEP0190, Node warning after upgrading to v3.8.51 #15315)". It records every call made through the module's__setExecFileImplseam and fails if any of them combinesshell: truewith a non-empty argument array.release/v3.8.52with onlytool-detector.tsreverted):omniroute doctorwith Node 24, no DEP0190 line, same detection result) would settle it.Scope
src/lib/cli-helper/tool-detector.ts, the win32 test file, and a one-line changelog fragment.shell: true. It now accepts the shim being run throughcmd.exeas well, and still throws for a direct spawn of the.cmd, which reproduces the CVE-2024-27980 refusal.Validation
tool-detector.test.ts,cli-helper-tool-detector-paths-6162.test.ts,tool-detector-opencode-jsonc-10227.test.ts,cli-tool-detector-imports.test.ts,tool-detector-win32-7279.test.ts): 24 of 24.eslint(with the repository's suppressions) andprettier --checkon the two touched files and the changelog fragment,check:ai-attribution --rangeandcheck:changelog-integrity: all clean.Reviewer Notes
npm-exec.mjsway. When the shim needs cmd.exe, the detector now runscmd.exeitself with an argument array,["/d", "/c", <shim path>, "--version"], and noshelloption. Node quotes each element, so a path with spaces stays one argument, nothing is interpolated into a shell string (Hard Rule deps: bump qs from 6.14.1 to 6.14.2 #13) and DEP0190 does not apply.npmExecInvocationjoins the command line itself, but that is safe only because its tokens are literals; here the path is a runtime value, andcliRuntime.tsalready says not to interpolate it.cmd.execomes fromComSpec(the lookup env, thenprocess.env) withcmd.exeas the fallback.Program Files (x86)) still loses its quotes undercmd /c's rules, as it did before this change; this PR does not change that case.src/lib/cliTools/codexModelCatalog.tsaround line 200 spawns.cmdshims withshell: trueplus an argument array too, so it likely emits the same warning.changelog.d/fixes/PENDING-tool-detector-dep0190.md, one line, left for you to rename.