CodePilot icon indicating copy to clipboard operation
CodePilot copied to clipboard

Codepilot配置好智谱的url和APIKEY,却无法调用它的glm-4.7模型

Open AI-Explorer-Lab opened this issue 9 months ago • 8 comments

我在setting里添加配置

API Base URL: "https://open.bigmodel.cn/api/anthropic",
API Key: "xxxx"  
Extra Environment Variables
{"API_TIMEOUT_MS":"3000000","ANTHROPIC_API_KEY":"xxxx"}

聊天框的界面里出现了glm-4.7的选项,但是一对话,模型却还是显示Connected (claude-haiku-4-5-20251001),用的还是Claude Sonnet 4.5模型。这是怎么回事,如何解决?

配置完成后尝试过重启codepilot,但是没用。Mac M2,codepilot版本:0.7.0

AI-Explorer-Lab avatar Feb 11 '26 01:02 AI-Explorer-Lab

PS: 已更新到0.80,还是没有解决

AI-Explorer-Lab avatar Feb 11 '26 01:02 AI-Explorer-Lab

直接点“快捷添加”那个胶囊按钮配置试试。

op7418 avatar Feb 11 '26 03:02 op7418

直接点“快捷添加”那个胶囊按钮配置试试。

我试过了,只需要配置apikey。询问它是什么模型后,回复是:我是 Claude,由 Anthropic 开发的 AI 助手。我基于 Anthropic 的大语言模型构建,具体来说是 Claude Sonnet 4.5 版本。没有成功

AI-Explorer-Lab avatar Feb 11 '26 08:02 AI-Explorer-Lab

同样,我在powershell里面可以正常使用glm不用登录claude,但是在Codepilot里面始终显示Disconnected,聊天窗口显示GLM-4.7,但是一聊天就Error: Claude Code executable not found at D:\Programs\CodePilot\resources\standalone\node_modules@anthropic-ai\claude-agent-sdk\cli.js. Is options.pathToClaudeCodeExecutable set?

Metazyl avatar Feb 11 '26 08:02 Metazyl

同样,我在powershell里面可以正常使用glm不用登录claude,但是在Codepilot里面始终显示Disconnected,聊天窗口显示GLM-4.7,但是一聊天就Error: Claude Code executable not found at D:\Programs\CodePilot\resources\standalone\node_modules@anthropic-ai\claude-agent-sdk\cli.js. Is options.pathToClaudeCodeExecutable set?

同样的问题,你解决了嘛

rulke avatar Feb 14 '26 07:02 rulke

直接点“快捷添加”那个胶囊按钮配置试试。

大佬,我在powershell里可以正常使用cc, 在Codepilot里面始终显示Disconnected,我看报错是Claude Code executable not found at,这个执行器我不能自己配置嘛,我尝试在codepilot里面增加配置文件加载执行器但没有生效,在终端里setx执行器路径也没有生效,请问这个可以怎么解决呢,谢谢

rulke avatar Feb 14 '26 07:02 rulke

同样,我在powershell里面可以正常使用glm不用登录claude,但是在Codepilot里面始终显示Disconnected,聊天窗口显示GLM-4.7,但是一聊天就Error: Claude Code executable not found at D:\Programs\CodePilot\resources\standalone\node_modules@anthropic-ai\claude-agent-sdk\cli.js. Is options.pathToClaudeCodeExecutable set?

同样的问题,你解决了嘛

没解决,投奔zcode了

Metazyl avatar Feb 14 '26 08:02 Metazyl

你好!感谢大家的反馈。

关于智谱 GLM-4.7 模型无法调用的问题,从评论中看到主要有两类情况:

1. API Provider 配置问题(已修复)

如果是配置了第三方 Provider 后出现 "process exited with code 1" 或 "Disconnected",这与 extra_env 空值覆盖环境变量的 bug 相关,已在以下 commit 中修复:

  • 83a0109 — sanitize env variables to prevent spawn EINVAL with third-party API providers
  • c0e96bd — filter undefined env values

2. Claude Code executable not found(Windows 用户)

评论中 @Metazyl 和 @rulke 遇到的 "Claude Code executable not found" 错误,这是 Windows 下 .cmd wrapper 路径解析的问题,已在以下 commit 中修复:

  • 01e7e0c — parse Windows .cmd wrapper to extract real CLI script path

请更新到最新版本 v0.10.11,该版本包含了所有上述修复。更新后:

  1. 重新配置 API Provider(删除后重新添加)
  2. 确保 Claude Code CLI 已正确安装(终端运行 claude --version 确认)
  3. 如果是 Windows 用户,确保 Claude Code 在 PATH 中

如果更新后仍有问题,请提供操作系统版本和开发者工具中的错误日志。先关闭此 issue,如有问题欢迎重新打开。

op7418 avatar Feb 23 '26 10:02 op7418