Detect command not found when checking codex/claude CLI on Windows#1492
Merged
juliusmarminge merged 1 commit intopingdotgg:mainfrom Mar 28, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What Changed
Use
isWindowsCommandNotFoundto check if codex/claude CLI is missing.Extracted
spawnAndCollectmethod to avoid copypasting the check.Why
On Windows, missing Codex CLI gives misleading message:
"Codex CLI is installed but failed to run. 'codex' is not recognized as an internal or external command, operable program or batch file."
Checklist
Note
Low Risk
Low risk: refactors provider health-check command execution and improves Windows-only error detection for missing CLIs, which mainly affects status reporting and messaging.
Overview
Improves Windows handling for provider health checks by treating
cmd.exe"command not recognized" failures as a missing CLI, so Codex/Claude report not installed/on PATH instead of a generic execution failure.Extracts a shared
spawnAndCollecthelper inproviderSnapshot.ts(used byCodexProviderandClaudeProvider) and exportsisWindowsCommandNotFoundfromprocessRunner.tsto centralize this detection.Written by Cursor Bugbot for commit 0a2f12c. This will update automatically on new commits. Configure here.
Note
Detect command-not-found errors for Codex and Claude CLI on Windows
spawnAndCollecthelper inproviderSnapshot.tsthat centralizes process spawning, stream collection, and Windows command-not-found detection.ClaudeProviderandCodexProvidernow delegate tospawnAndCollectinstead of handling spawn logic inline.ENOENT-style error instead of returning a successfulCommandResultwith exit code 9009.Macroscope summarized 0a2f12c.