CodePilot icon indicating copy to clipboard operation
CodePilot copied to clipboard

0.50.2 还是无法连接 cc-switch 配置的 Claude CLI

Open patgdut opened this issue 7 months ago • 2 comments

{"diagnosis":{"overallSeverity":"error","probes":[{"probe":"cli","severity":"ok","findings":[{"severity":"ok","code":"cli.found","message":"Claude CLI found at /opt/homebrew/bin/claude","detail":"Version: 2.1.107 (Claude Code)"}],"durationMs":496},{"probe":"auth","severity":"error","findings":[{"severity":"error","code":"auth.no-credentials","message":"No API credentials found (environment, DB settings, providers, or OpenAI OAuth)","repairActions":[{"id":"reimport-env-config","label":"Re-import environment config","description":"Re-read API keys and settings from environment variables into the database"}]},{"severity":"ok","code":"auth.resolved-ok","message":"Resolved provider has usable credentials (authStyle: api_key)"}],"durationMs":1},{"probe":"provider","severity":"ok","findings":[{"severity":"ok","code":"provider.count","message":"0 provider(s) configured"},{"severity":"ok","code":"provider.resolve-ok","message":"Provider resolution path: environment variables","detail":"No model selected (will use provider defaults)"}],"durationMs":0},{"probe":"features","severity":"ok","findings":[{"severity":"ok","code":"features.thinking-ok","message":"Thinking mode "adaptive" is compatible with protocol "anthropic""}],"durationMs":2},{"probe":"network","severity":"ok","findings":[{"severity":"ok","code":"network.reachable","message":"Anthropic API (https://api.anthropic.com) is reachable","detail":"Status: 403"}],"durationMs":724},{"probe":"live","severity":"error","findings":[{"severity":"error","code":"live.failed","message":"Live test failed — PROCESS_CRASH: Claude Code process exited with an error. Common causes:\n• Invalid or missing API Key\n• Incorrect Base URL configuration\n• Network connectivity issues","detail":"Check your API key and provider settings. Run Provider Doctor in Settings for detailed diagnostics."}],"durationMs":2113}],"repairs":[{"type":"set-default-provider","label":"Set first valid provider as default","description":"Fix the stale default by pointing to an existing provider","addresses":["provider.no-default","provider.default-missing","auth.no-credentials"]},{"type":"reimport-env-config","label":"Re-import environment config","description":"Re-read API keys and settings from environment variables into the database","addresses":["auth.no-credentials","auth.env-api-key","auth.env-auth-token"]}],"timestamp":"2026-04-15T11:21:21.056Z","durationMs":2114},"runtimeLogs":[],"providerResolution":{"protocol":"anthropic","authStyle":"api_key","hasCredentials":true,"settingSources":["user","project","local"]},"liveProbeError":{"category":"PROCESS_CRASH","userMessage":"Claude Code process exited with an error. Common causes:\n• Invalid or missing API Key\n• Incorrect Base URL configuration\n• Network connectivity issues","actionHint":"Check your API key and provider settings. Run Provider Doctor in Settings for detailed diagnostics.","retryable":false,"rawMessage":"Claude Code process exited with code 1"},"exportedAt":"2026-04-15T11:21:30.112Z"}

patgdut avatar Apr 15 '26 11:04 patgdut

v0.50.3 发布:https://github.com/op7418/CodePilot/releases/tag/v0.50.3

这版做了两项跟你报告的症状直接相关的改动:

  1. Agent 引擎选择逻辑彻底简化:去掉了"自动"模式里基于凭据推断的逻辑(就是之前导致 Doctor JSON 自相矛盾的根源)。现在只看"你装没装 Claude Code CLI":装了走 Claude Code,没装走 AI SDK,不再猜你的凭据状态。

  2. 没配置服务商时入口引导:如果你在 CodePilot 里没有显式添加过服务商(只靠 cc-switch 的 ~/.claude/settings.json),发消息时会直接弹出 SetupCenter 引导你添加一个——而不是抛 "No provider credentials" 或 "Not logged in" 这种不明错误。

⚠️ cc-switch 用户注意:升级后首次发消息会被引导去"设置 → 服务商"添加一个 CodePilot 服务商。这是有意行为——cc-switch 的 settings.json 现在归 Claude Code CLI 管,CodePilot 需要有自己的服务商记录。添加一次后后续使用不受影响。

升级后试一下,如果还有问题麻烦重新跑 Doctor 并贴新 JSON。

op7418 avatar Apr 16 '26 02:04 op7418

我是claude订阅用户,装了这个新的版本之后一直提示检测不到API,已经无法使用了

enzo-geyin avatar Apr 16 '26 16:04 enzo-geyin