From 49b2c6a0e6a6010f959862f27e3a4645696eac25 Mon Sep 17 00:00:00 2001 From: yi111 <153097222+Yi-111-a@users.noreply.github.com> Date: Fri, 11 Sep 2026 01:32:11 +0800 Subject: [PATCH 1/3] fix(ai-client): resolve the AI CLI on Windows with where + cross-spawn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit detectClaudeCli() resolved each candidate through `bash -lc command -v`, `zsh -lc` or `which`, then gated the result on existsSync(). On Windows those programs come from Git Bash or WSL and print MSYS paths such as /c/Users/me/AppData/Roaming/npm/claude, which Node resolves against the current drive (C:\c\...). existsSync() was therefore always false, all three fallbacks failed for every candidate, and every AI-backed command threw "no AI CLI" no matter what was installed. - resolve Windows candidates with the native `where` (the `which` equivalent), which returns a path the Windows APIs accept - pickWindowsCommand() accepts only .exe / .cmd / .bat: `where` also lists npm's extensionless POSIX shim, usually first, and CreateProcess cannot start that one - spawn through cross-spawn (already a dependency, already used by utils/exec.ts): Node's spawn refuses to run a .cmd shim without a shell and fails with EINVAL; cross-spawn launches it via cmd.exe and escapes each argument, so the prompt is still never spliced into a shell string - drop the POSIX strategies from the Windows path entirely: a WSL bash.exe reachable from the Windows PATH returns Linux paths, and a Git Bash one returns MSYS paths — neither is usable from Node on Windows - take the platform as an injectable parameter in resolveCliPath() so the Windows branch is covered by the ubuntu/macos CI Validation - unit: 17/17 in src/__tests__/ai-client.test.ts (5 pre-existing + 12 new covering pickWindowsCommand and resolveCliPath on win32/posix) - typecheck clean, build clean - Windows 11 / Node 22, real end-to-end with an npm-style shim trio (claude + claude.cmd + claude.ps1) on PATH: before -> `teamai import --from-claude --all` logged "AI classification partially failed ... 3 AI task(s) failed" and wrote no import session; after -> no error, and the session holds 3 items, all accepted - detection latency on Windows drops from ~18s per call (7 candidates x 3 strategies, each waiting out the 5s probe timeout) to ~0.3s - Windows full suite compared per test: main and this branch fail the same assertions (114 across 41 files, none in ai-client.test.ts); the only delta is the 12 new tests, all passing. The failing files are pre-existing POSIX-separator assertions that CI never sees, since it runs ubuntu + macos only. --- src/__tests__/ai-client.test.ts | 134 +++++++++++++++++++++- src/utils/ai-client.ts | 189 +++++++++++++++++++++++--------- 2 files changed, 268 insertions(+), 55 deletions(-) diff --git a/src/__tests__/ai-client.test.ts b/src/__tests__/ai-client.test.ts index 11070440a0..396559ef49 100644 --- a/src/__tests__/ai-client.test.ts +++ b/src/__tests__/ai-client.test.ts @@ -2,15 +2,23 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import type { ChildProcess } from 'node:child_process'; import type { EventEmitter } from 'node:events'; -// ─── Mock child_process ──────────────────────────────────────────────────── +// ─── Mock child_process / cross-spawn ────────────────────────────────────── // vi.mock 会被 hoist 到文件顶部,factory 中不能引用外部 const/let 变量 // 改用 vi.fn() 内联,通过 vi.mocked(spawn) 在测试中动态设置行为 +// callClaude 经 cross-spawn 启动 CLI:Windows 上 CLI 多为 npm 生成的 `.cmd` shim, +// Node 原生 spawn 无权直接执行(EINVAL),必须由 cross-spawn 经 cmd.exe 转义启动。 +vi.mock('cross-spawn', () => ({ + default: vi.fn(), +})); + vi.mock('node:child_process', () => ({ - spawn: vi.fn(), - // detectClaudeCli 通过 execFileSync('bash', ['-lc', 'command -v ']) 获取绝对路径, + // detectClaudeCli 探测绝对路径:POSIX 走 bash -lc,Windows 走 where。 // 测试环境中返回伪路径,配合 existsSync mock 让探测成功并选中第一个候选 'claude'。 - execFileSync: vi.fn(() => '/usr/local/bin/claude\n'), + // Windows 分支只接受可执行后缀(.exe/.cmd/.bat),因此伪路径需要按平台给出。 + execFileSync: vi.fn(() => + process.platform === 'win32' ? 'C:\\npm\\claude.cmd\n' : '/usr/local/bin/claude\n' + ), })); // mock existsSync,使探测到的伪路径被视为存在 @@ -18,8 +26,14 @@ vi.mock('node:fs', () => ({ existsSync: vi.fn(() => true), })); -import { spawn } from 'node:child_process'; -import { callClaude, callClaudeParallel } from '../utils/ai-client.js'; +import spawn from 'cross-spawn'; +import { execFileSync } from 'node:child_process'; +import { + callClaude, + callClaudeParallel, + pickWindowsCommand, + resolveCliPath, +} from '../utils/ai-client.js'; // ─── Helpers ─────────────────────────────────────────────────────────────── @@ -190,3 +204,111 @@ describe('callClaudeParallel', () => { expect(maxRunning).toBeLessThanOrEqual(2); }); }); + +// ─── pickWindowsCommand ──────────────────────────────────────────────────── +// `where` 的输出解析是纯函数,因此在所有平台上都能回归(Windows 上的真实探测 +// 由这些用例固定契约,不需要 Windows runner)。 + +describe('pickWindowsCommand', () => { + it('npm 的 shim 三件套:跳过无扩展名的 POSIX shim,选中 .cmd', () => { + // `where claude` 的真实输出顺序:无扩展名的 shim 排在最前 + const output = [ + 'C:\\Users\\me\\AppData\\Roaming\\npm\\claude', + 'C:\\Users\\me\\AppData\\Roaming\\npm\\claude.cmd', + '', + ].join('\r\n'); + + expect(pickWindowsCommand(output)).toBe('C:\\Users\\me\\AppData\\Roaming\\npm\\claude.cmd'); + }); + + it('原生安装的 .exe 优先于同名 .cmd(PATHEXT 优先级)', () => { + const output = [ + 'C:\\tools\\claude.cmd', + 'C:\\Program Files\\Claude\\claude.exe', + ].join('\r\n'); + + expect(pickWindowsCommand(output)).toBe('C:\\Program Files\\Claude\\claude.exe'); + }); + + it('.bat 与 .exe 并存时选中 .exe', () => { + const output = ['C:\\tools\\claude.bat', 'C:\\tools\\claude.exe'].join('\n'); + + expect(pickWindowsCommand(output)).toBe('C:\\tools\\claude.exe'); + }); + + it('忽略前后空白并把扩展名匹配视为大小写不敏感', () => { + expect(pickWindowsCommand(' C:\\npm\\CLAUDE.CMD \r\n')).toBe('C:\\npm\\CLAUDE.CMD'); + }); + + it('只有无扩展名的 shim 时返回 null(CreateProcess 无法启动它)', () => { + expect(pickWindowsCommand('C:\\npm\\claude\r\n')).toBeNull(); + }); + + it('where 未找到任何匹配时返回 null', () => { + expect(pickWindowsCommand('')).toBeNull(); + expect(pickWindowsCommand('\r\n \r\n')).toBeNull(); + }); +}); + +// ─── resolveCliPath ──────────────────────────────────────────────────────── +// platform 参数可注入,使 Windows 分支在 ubuntu / macos 的 CI 上也有覆盖。 + +/** execFileSync 是重载函数,vi.mocked 推不出返回值类型,这里取一个够用的视图。 */ +const execFileSyncMock = vi.mocked(execFileSync) as unknown as { + mock: { calls: unknown[][] }; + mockReturnValueOnce: (value: unknown) => void; + mockImplementationOnce: (impl: () => never) => void; +}; + +describe('resolveCliPath', () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + it('win32:走 where,返回 where 输出里可启动的那条路径', () => { + execFileSyncMock.mockReturnValueOnce('C:\\npm\\claude\r\nC:\\npm\\claude.cmd\r\n'); + + expect(resolveCliPath('claude', 'win32')).toBe('C:\\npm\\claude.cmd'); + expect(execFileSyncMock.mock.calls[0][0]).toBe('where'); + expect(execFileSyncMock.mock.calls[0][1]).toEqual(['claude']); + }); + + it('win32:只调用 where,不碰 bash / zsh / which', () => { + execFileSyncMock.mockReturnValueOnce('C:\\npm\\claude.cmd\r\n'); + + resolveCliPath('claude', 'win32'); + + expect(execFileSyncMock.mock.calls.map((call) => call[0])).toEqual(['where']); + }); + + it('win32:where 未命中(退出码非 0)时返回 null', () => { + execFileSyncMock.mockImplementationOnce(() => { + throw new Error('Command failed: where claude'); + }); + + expect(resolveCliPath('claude', 'win32')).toBeNull(); + }); + + it('win32:where 只给出无扩展名的 shim 时返回 null,避免 spawn EINVAL', () => { + execFileSyncMock.mockReturnValueOnce('C:\\npm\\claude\r\n'); + + expect(resolveCliPath('claude', 'win32')).toBeNull(); + }); + + it('posix:优先使用 bash login shell 的结果', () => { + execFileSyncMock.mockReturnValueOnce('/usr/local/bin/claude\n'); + + expect(resolveCliPath('claude', 'linux')).toBe('/usr/local/bin/claude'); + expect(execFileSyncMock.mock.calls[0][0]).toBe('bash'); + }); + + it('posix:bash 抛错时回退到 zsh', () => { + execFileSyncMock.mockImplementationOnce(() => { + throw new Error('spawn bash ENOENT'); + }); + execFileSyncMock.mockReturnValueOnce('/opt/homebrew/bin/claude\n'); + + expect(resolveCliPath('claude', 'darwin')).toBe('/opt/homebrew/bin/claude'); + expect(execFileSyncMock.mock.calls.map((call) => call[0])).toEqual(['bash', 'zsh']); + }); +}); diff --git a/src/utils/ai-client.ts b/src/utils/ai-client.ts index c5391d7348..0dbdb805b1 100644 --- a/src/utils/ai-client.ts +++ b/src/utils/ai-client.ts @@ -1,4 +1,5 @@ -import { spawn, execFileSync } from 'node:child_process'; +import { execFileSync } from 'node:child_process'; +import spawn from 'cross-spawn'; import { existsSync } from 'node:fs'; import { log } from './logger.js'; @@ -10,6 +11,14 @@ const ALLOWED_CLI_CANDIDATES = [ /** CLI 探测超时(毫秒),防止 execFileSync 挂死。 */ const CLI_DETECT_TIMEOUT_MS = 5_000; +/** + * 可按扩展名直接启动的 Windows 可执行后缀,按 PATHEXT 优先级排列。 + * + * `npm install -g` 在 Windows 上同时生成三个 shim:无扩展名的 POSIX 脚本、 + * `.cmd`、`.ps1`。无扩展名的那个 CreateProcess 无法启动。 + */ +const WIN_EXEC_EXTENSIONS = ['.exe', '.cmd', '.bat'] as const; + /** * 默认 AI 调用超时时间(毫秒)。 * 10 分钟适用于大型仓库(200+ 文件)的 codebase 文档生成场景。 @@ -28,17 +37,134 @@ interface CliInfo { } /** - * 按优先级探测可用的 AI CLI,返回命令名与绝对路径。 + * 从 `where ` 的输出中挑出可启动的那一条。 * - * 各 CLI 非交互调用语法不同: - * - claude / claude-internal / codebuddy / workbuddy / openclaw:` -p ` - * - codex / codex-internal:` exec ` + * `where` 会列出所有匹配项,且顺序上无扩展名的 POSIX shim 往往排在前面 + * (例如 `C:\npm\claude` 先于 `C:\npm\claude.cmd`)。无扩展名的文件 + * CreateProcess 无法启动,因此这里只接受可执行后缀。 + * + * @param whereOutput `where ` 的原始 stdout + * @returns 首个可启动路径;没有可执行后缀时返回 null + */ +export function pickWindowsCommand(whereOutput: string): string | null { + const lines = whereOutput + .split(/\r?\n/) + .map((line) => line.trim()) + .filter((line) => line.length > 0); + + for (const ext of WIN_EXEC_EXTENSIONS) { + const hit = lines.find((line) => line.toLowerCase().endsWith(ext)); + if (hit !== undefined) return hit; + } + return null; +} + +/** + * 用 Windows 原生命令 `where` 解析候选 CLI,返回真正的 Windows 路径。 * - * 依次通过以下方式获取绝对路径,确保覆盖各类 shell 环境: + * `where` 是 `which` 的 Windows 原生等价物,返回 `C:\...\claude.cmd` 这类 + * Windows API 能识别的路径。 + * + * @param cmd 候选命令名 + * @returns 存在且可启动的绝对路径;未安装时返回 null + */ +function whereOnWindows(cmd: string): string | null { + try { + const out = execFileSync('where', [cmd], { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + shell: false, + timeout: CLI_DETECT_TIMEOUT_MS, + }); + const p = pickWindowsCommand(out); + return p !== null && existsSync(p) ? p : null; + } catch { + // where 未找到时退出码非 0(stderr 为 "INFO: Could not find files..."),走这里 + return null; + } +} + +/** + * POSIX 侧的策略链,依次尝试各 shell 环境,返回第一个解析成功且真实存在的路径: * 1. `bash -lc command -v ` —— login shell,覆盖 ~/.nvm/ 等路径 * 2. `zsh -lc command -v ` —— macOS 默认 shell fallback * 3. `which ` —— 最终 fallback,使用 process.env.PATH 直接查找 * + * @param cmd 候选命令名 + * @returns 存在的绝对路径;三种策略都失败时返回 null + */ +function whichOnPosix(cmd: string): string | null { + // 策略 1:bash login shell(shell: false 是 execFileSync 默认行为,此处显式标注) + try { + const p = execFileSync('bash', ['-lc', `command -v ${cmd}`], { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + shell: false, + timeout: CLI_DETECT_TIMEOUT_MS, + }).trim(); + if (p && existsSync(p)) return p; + } catch { + // 继续尝试下一策略 + } + + // 策略 2:zsh login shell(macOS 默认 shell / bash 不可用时) + try { + const p = execFileSync('zsh', ['-lc', `command -v ${cmd}`], { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + shell: false, + timeout: CLI_DETECT_TIMEOUT_MS, + }).trim(); + if (p && existsSync(p)) return p; + } catch { + // 继续尝试下一策略 + } + + // 策略 3:which 命令(使用 process.env.PATH,覆盖 fish / CI 容器等环境) + try { + const p = execFileSync('which', [cmd], { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + shell: false, + timeout: CLI_DETECT_TIMEOUT_MS, + }).trim(); + if (p && existsSync(p)) return p; + } catch { + // 三种策略都不可用 + } + + return null; +} + +/** + * 把候选 CLI 命令名解析为存在的绝对路径。 + * + * Windows 上必须走 `where`:`bash` / `which` 在 Windows 上来自 Git Bash 或 WSL, + * 返回的是 MSYS 风格路径(如 `/c/Users/me/AppData/Roaming/npm/claude`), + * Node 对这类路径 `existsSync` 恒为 false,spawn 也无法启动,所以 POSIX 策略在 + * Windows 上永远不可能成功(WSL 的 bash 更会返回完全不可用的 Linux 路径)。 + * + * `platform` 之所以可注入,是因为仓库 CI 只跑 ubuntu / macos:写死 process.platform + * 的话 Windows 分支将没有任何测试覆盖(这正是该缺陷长期未被发现的原因)。 + * + * @param cmd 候选命令名 + * @param platform 目标平台,默认当前进程平台 + * @returns 存在的绝对路径;该平台上不可用时返回 null + */ +export function resolveCliPath( + cmd: string, + platform: NodeJS.Platform = process.platform, +): string | null { + return platform === 'win32' ? whereOnWindows(cmd) : whichOnPosix(cmd); +} + +/** + * 按优先级探测可用的 AI CLI,返回命令名与绝对路径。 + * + * 各 CLI 非交互调用语法不同: + * - claude / claude-internal / codebuddy / workbuddy / openclaw:` -p ` + * - codex / codex-internal:` exec ` + * * 探测顺序:`claude` → `claude-internal` → `codex` → `codex-internal` → `codebuddy` → `workbuddy` → `openclaw`。 * 结果缓存,进程生命周期内只探测一次。 * @@ -46,47 +172,9 @@ interface CliInfo { * @throws 所有候选均不可用时抛出 Error */ function detectClaudeCli(): CliInfo { - const candidates = ALLOWED_CLI_CANDIDATES; - - for (const cmd of candidates) { - // 策略 1:bash login shell(shell: false 是 execFileSync 默认行为,此处显式标注) - try { - const p = execFileSync('bash', ['-lc', `command -v ${cmd}`], { - encoding: 'utf8', - stdio: ['ignore', 'pipe', 'ignore'], - shell: false, - timeout: CLI_DETECT_TIMEOUT_MS, - }).trim(); - if (p && existsSync(p)) return { cmd, absPath: p }; - } catch { - // 继续尝试下一策略 - } - - // 策略 2:zsh login shell(macOS 默认 shell / bash 不可用时) - try { - const p = execFileSync('zsh', ['-lc', `command -v ${cmd}`], { - encoding: 'utf8', - stdio: ['ignore', 'pipe', 'ignore'], - shell: false, - timeout: CLI_DETECT_TIMEOUT_MS, - }).trim(); - if (p && existsSync(p)) return { cmd, absPath: p }; - } catch { - // 继续尝试下一策略 - } - - // 策略 3:which 命令(使用 process.env.PATH,覆盖 fish / CI 容器等环境) - try { - const p = execFileSync('which', [cmd], { - encoding: 'utf8', - stdio: ['ignore', 'pipe', 'ignore'], - shell: false, - timeout: CLI_DETECT_TIMEOUT_MS, - }).trim(); - if (p && existsSync(p)) return { cmd, absPath: p }; - } catch { - // 此候选不可用,尝试下一个 - } + for (const cmd of ALLOWED_CLI_CANDIDATES) { + const absPath = resolveCliPath(cmd); + if (absPath !== null) return { cmd, absPath }; } throw new Error( @@ -95,6 +183,7 @@ function detectClaudeCli(): CliInfo { ); } + /** * 根据 CLI 类型构建非交互参数数组。 * @@ -128,6 +217,8 @@ export function getAICliName(): string { * 通过子进程直接调用 AI CLI(claude/codex 等),返回 stdout 文本。 * * 按 CLI 类型自动选择 -p 或 exec 子命令,直接 spawn 绝对路径,不走 bash -lc,彻底消除 shell 拼接。 + * spawn 使用 cross-spawn:Windows 上 CLI 多为 npm 生成的 `.cmd` shim,Node 原生 + * spawn 无权直接执行 `.cmd`(报 EINVAL),cross-spawn 会正确地经 cmd.exe 启动并转义参数。 * CLI 探测优先级:`claude` → `claude-internal` → `codex` → `codex-internal` → `codebuddy` → `workbuddy` → `openclaw`, * 结果缓存,进程内只探测一次。 * @@ -155,8 +246,8 @@ export async function callClaude( log.debug(`[ai-client] calling ${_cliInfo.cmd}, timeout=${Math.round(timeoutMs / 1000)}s, prompt=${prompt.slice(0, 60).replace(/\n/g, ' ')}...`); const child = spawn(_cliInfo.absPath, buildCliArgs(_cliInfo.cmd, prompt), { stdio: ['ignore', 'pipe', 'pipe'] }); - child.stdout.on('data', (chunk: Buffer) => chunks.push(chunk)); - child.stderr.on('data', (chunk: Buffer) => errChunks.push(chunk)); + child.stdout?.on('data', (chunk: Buffer) => chunks.push(chunk)); + child.stderr?.on('data', (chunk: Buffer) => errChunks.push(chunk)); // 超时控制 const timer = setTimeout(() => { From 8b070394fdc9d0ca6faede8681c636a74930ffbb Mon Sep 17 00:00:00 2001 From: yi111 <153097222+Yi-111-a@users.noreply.github.com> Date: Fri, 11 Sep 2026 01:32:16 +0800 Subject: [PATCH 2/3] docs(usage-guide): document how the AI CLI is resolved per platform The docs said nothing about which AI CLI the AI-backed steps reuse or how it is found, so a Windows user had no way to tell a missing CLI apart from a broken lookup. Spell out the probe order and the per-platform mechanism, in both languages. --- docs/usage-guide.md | 2 ++ docs/usage-guide.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/usage-guide.md b/docs/usage-guide.md index 1aa36a5095..bf743a28fa 100644 --- a/docs/usage-guide.md +++ b/docs/usage-guide.md @@ -1176,6 +1176,8 @@ teamai import --from-repo https://github.com/org/repo --incremental teamai import --from-repo https://github.com/org/repo --skip-enrich ``` +AI-backed steps (`--deep-enrich`, knowledge enrichment) shell out to an AI coding CLI already installed on the machine instead of calling a model API directly. teamai probes `claude` → `claude-internal` → `codex` → `codex-internal` → `codebuddy` → `workbuddy` → `openclaw` and uses the first one it finds. On macOS and Linux the probe runs through a login shell, so a CLI installed under `~/.nvm/` is found too. On Windows it uses the native `where`, which returns the npm shim (`%APPDATA%\npm\claude.cmd`) that Windows can actually launch — a Git Bash or WSL `bash` only reports MSYS paths such as `/c/Users/...`, which Windows cannot start. + For GitLab behind an API gateway, set `GITLAB_URL` and `GITLAB_API_PREFIX=api/gitlab` before running `teamai import --from-org https://gitlab.example.com/myorg`. Organization listing uses the configured prefix on every page; an unset or blank prefix defaults to `api/v4`. The graph stores components, interfaces, configs, and cross-repo dependencies. `teamai recall` uses the graph for BM25 + graph-boosted ranking. diff --git a/docs/usage-guide.zh-CN.md b/docs/usage-guide.zh-CN.md index 1738e6c92b..3e65f8eea5 100644 --- a/docs/usage-guide.zh-CN.md +++ b/docs/usage-guide.zh-CN.md @@ -1145,6 +1145,8 @@ teamai import --from-repo https://github.com/org/repo --incremental teamai import --from-repo https://github.com/org/repo --skip-enrich ``` +需要 AI 的步骤(`--deep-enrich`、知识增强)复用本机已安装的 AI 编码 CLI,而不是直接调用模型 API。teamai 按 `claude` → `claude-internal` → `codex` → `codex-internal` → `codebuddy` → `workbuddy` → `openclaw` 的顺序探测,取第一个可用者。macOS / Linux 上探测经由 login shell,因此装在 `~/.nvm/` 下的 CLI 也能找到;Windows 上改用原生命令 `where`,拿到的是 Windows 真正能启动的 npm shim(`%APPDATA%\npm\claude.cmd`)——Git Bash 或 WSL 的 `bash` 只会返回 `/c/Users/...` 这类 MSYS 路径,Windows 无法启动。 + 对于 API 网关后的 GitLab,先设置 `GITLAB_URL` 和 `GITLAB_API_PREFIX=api/gitlab`,再运行 `teamai import --from-org https://gitlab.example.com/myorg`。组织仓库列表的每一页请求都会使用配置的前缀;未设置或为空时默认使用 `api/v4`。 图谱存储组件、接口、配置和跨仓库依赖关系。`teamai recall` 利用图谱进行 BM25 + graph-boost 增强排名。 From 24e47796dd27f9dd128ce7803bebca664e203f49 Mon Sep 17 00:00:00 2001 From: yi111 <153097222+Yi-111-a@users.noreply.github.com> Date: Fri, 11 Sep 2026 01:32:21 +0800 Subject: [PATCH 3/3] fix(ai-client): use English for the missing-AI-CLI error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGENTS.md requires CLI user-facing output to be English. This message is the one user-visible string on the failure path this branch fixes — it is what every AI-backed command printed on Windows — and it was still Chinese. Split out from the detection fix so it can be dropped or moved to its own PR on request. --- src/utils/ai-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/ai-client.ts b/src/utils/ai-client.ts index 0dbdb805b1..bee9b63f36 100644 --- a/src/utils/ai-client.ts +++ b/src/utils/ai-client.ts @@ -178,8 +178,8 @@ function detectClaudeCli(): CliInfo { } throw new Error( - 'AI CLI 不可用:请安装以下任意一个 CLI 工具:' + - 'claude / claude-internal / codex / codex-internal / codebuddy / workbuddy / openclaw' + 'AI CLI unavailable: install one of claude / claude-internal / codex / ' + + 'codex-internal / codebuddy / workbuddy / openclaw' ); }