fix(windows): resolve gcloud/gog/tailscale PATHEXT shims before spawn#74881
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-reproducible. The linked bug gives concrete native Windows PowerShell steps, and current main still invokes bare helper names in the documented Gmail setup/run and gateway watcher paths; I did not run a native Windows live repro in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the focused Windows Gmail helper fix after required checks finish, keeping the resolver scoped to helper spawn compatibility and the existing Windows-safe Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. The linked bug gives concrete native Windows PowerShell steps, and current main still invokes bare helper names in the documented Gmail setup/run and gateway watcher paths; I did not run a native Windows live repro in this read-only review. Is this the best way to solve the issue? Yes. The current PR direction is the narrowest maintainable fix I found: Windows-only filesystem PATH/PATHEXT resolution, no What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6c8974f3f5a9. |
c17ac87 to
423d53c
Compare
b8f557f to
815b7d9
Compare
815b7d9 to
6f238d6
Compare
… to fix ENOENT on Windows
6f238d6 to
cdcbad0
Compare
|
Merged after maintainer prep.
|
Closes #54470
Problem
On native Windows,
openclaw webhooks gmail setup --accountcrashed withError: spawn gcloud ENOENT. Node'schild_process.spawnwithshell: falsedoes not consult PATHEXT, so baregcloud,gog, andtailscalecan fail even when Windows resolves them to valid.cmd/.exeshims.Solution
gcloud,gog, andtailscalethrough a Windows-only PATH/PATHEXT filesystem probe before spawning..cmd, then.exe, then the first matching PATH/PATHEXT result, without executingwhere.exeduring lookup.openclaw webhooks gmail setup/runCLI path.gog serve.cmd/.batshims through pinned%SystemRoot%\System32\cmd.exewith argv escaping instead of raw direct.cmdspawn.Real behavior proof
Maintainer-prepared Windows fix;
proof: overrideis applied because this environment does not provide a native Windows Gmail/Tailscale setup for live after-fix capture. The repaired branch is validated with the Windows command-wrapper tests and the Gmail setup/watcher shards listed below, including PATH/PATHEXT resolver coverage that no longer shells out throughwhere.exe.Tests
pnpm test src/infra/executable-path.test.ts src/hooks/gmail-setup-utils.test.ts src/hooks/gmail.test.ts src/hooks/gmail-watcher-lifecycle.test.ts src/process/exec.windows.test.ts src/process/windows-command.test.tspnpm check:changedpnpm exec oxfmt --check CHANGELOG.md src/infra/executable-path.ts src/infra/executable-path.test.ts src/hooks/gmail-watcher.ts src/hooks/gmail-ops.tspnpm lint:plugins:no-monolithic-plugin-sdk-entry-importsNotes
pnpm plugin-sdk:api:checkcurrently reports baseline hash drift on untouched main as well; this prepared branch no longer changes Plugin SDK exports.