Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(cli): guard against empty where output on Windows

Ivan1121b81f12d5
diff --git a/src/shared/services/cliRuntime.ts b/src/shared/services/cliRuntime.ts
index 5cb2cda0f3..ac8b390bfa 100644
--- a/src/shared/services/cliRuntime.ts
+++ b/src/shared/services/cliRuntime.ts
@@ -544,6 +544,9 @@ const locateCommand = async (command: string, env: Record<string, string | undef
.split(/\r?\n/)
.map((l) => l.trim())
.filter(Boolean);
+ if (lines.length === 0) {
+ return { installed: false, commandPath: null, reason: "not_found" };
+ }
const winExt = /\.(cmd|exe|bat|com)$/i;
const preferred = lines.find((l) => winExt.test(l)) || lines[0];
return { installed: true, commandPath: preferred, reason: null };