Skip to content

[Bug]: spawn gemini ENOENT on Windows (missing .cmd extension handling) #98573

Description

@studiodevlabs

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When running OpenClaw on Windows configured with the google-gemini-cli provider, the application crashes when attempting to execute the Gemini CLI.

The error is spawn gemini ENOENT. This indicates that the application is trying to spawn a process named exactly gemini.

On Windows, global npm packages create a gemini.cmd file in the PATH, not a gemini executable. Node.js's child_process.spawn() does not automatically append .cmd extension extensions on Windows by default, causing the lookup to fail.

Steps to reproduce

  • On a Windows machine, install the prerequisites globally: npm install -g @google/gemini-cli.
  • Verify the installation works in a terminal by running gemini --help.
  • Configure OpenClaw to use the google-gemini-cli provider.
  • Start OpenClaw and trigger an action that uses the provider.

Expected behavior

OpenClaw should successfully execute the global gemini command and receive the output.

Actual behavior

OpenClaw fails immediately when trying to run the command.

OpenClaw version

2026.6.11

Operating system

Windows 11

Install method

npm global

Model

gemini 3.1 pro preview

Provider / routing chain

User Input -> Agent Policy Check (agents/tool-policy) -> Routing Decision: Use CLI Backend -> Provider Selection: Use google-gemini-cli provider -> OS Execution: process/supervisor attempts spawn('gemini') -> [FAILURE HERE]

Additional provider/model setup details

No response

Logs

15:41:55+05:30 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=google-gemini-cli model=gemini-3.1-pro-preview ...
15:41:55+05:30 warn process/supervisor {"subsystem":"process/supervisor"} spawn failed: runId=ae9f581a-0774-4230-bcdb-4b1fc0d1e837 reason=Error: spawn gemini ENOENT
15:39:50+05:30 error Embedded agent failed before reply: spawn gemini ENOENT

Screenshots, recordings, and evidence

Image

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions