-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Bug Description / Bug描述
In a Windows environment, the collaborating-with-gemini skill fails to execute the gemini command, returning "no content" or an "Exit code 1" error. Although the gemini command works correctly in manual PowerShell or CMD windows, the bridge script fails to locate or execute it.
Root Cause: 1. PATH Discrepancy: The non-interactive shell used by Claude does not always inherit the user-level PATH where npm or pip installs the Gemini CLI (e.g., AppData\Roaming\npm).
2. Subprocess Issue: On Windows, gemini is often a .cmd or .ps1 batch file. The bridge script uses subprocess.Popen(..., shell=False), which cannot execute batch files directly; it requires shell=True or the absolute path to the executable.
在 Windows 环境下,collaborating-with-gemini 无法执行 gemini 命令。尽管手动在终端可以运行,但脚本报错或输出为空。主要原因是:1. Claude 的非交互式环境未加载用户 PATH;2. 脚本使用 shell=False 无法启动 Windows 的 .cmd 批处理文件。
Environment / 运行环境
OS: Windows 11 (Build 26200.7462)
Skills Installation: user-level (C:\Users\hybird.claude\skills)
Claude Code Version: [请填写您的版本,例如 0.x.x]
Gemini CLI Version: [请填写您的版本,例如 0.x.x]
Affected Skill / 受影响的 Skill
[ ] collaborating-with-codex
[x] collaborating-with-gemini
[ ] Other / 其他
Steps to Reproduce / 复现步骤
Install Gemini CLI via npm on Windows.
Open Claude and attempt to use a skill that triggers collaborating-with-gemini (e.g., "Review this code using gemini").
The task starts but immediately returns an error or empty output.
Check logs: /usr/bin/bash: line 1: type: ...: not found or gemini CLI not found.
Logs / 错误日志
● Bash(cmd.exe /c "where gemini 2>nul || echo gemini CLI not found")
⎿ Microsoft Windows [版本 10.0.26200.7462]
(c) Microsoft Corporation。保留所有权利。
F:\客户端项目\项目\WpfAppSNT> gemini CLI not found
● Error: Exit code 1
/usr/bin/bash: line 1: type: C:\Users\hybird\AppData\Local\Temp\claude...\tasks\b576870.output: not found
Skill Call Parameters / Skill 调用参数
collaborating-with-gemini
{
"PROMPT": "Review the code in the current directory",
"cd": "F:\客户端项目\项目\WpfAppSNT",
"sandbox": false,
"SESSION_ID": "",
"return_all_messages": false
}
Additional Context / 其他信息
The issue can be resolved by:
Using shutil.which to find the absolute path and falling back to common npm/python script locations.
Setting shell=True in subprocess.Popen when running on Windows.
Handling potential encoding issues with Chinese characters in workspace paths.
可以通过在 subprocess.Popen 中设置 shell=True 并通过代码主动检索 AppData 下的 gemini.cmd 路径来修复此问题。