fix: add explicit moonshot/kimi case in provider switch

CreateProvider() had no case for provider name "moonshot" or "kimi",
causing it to fall through the switch silently and rely only on
model-name fallback detection. Add explicit case so that when
PICOCLAW_AGENTS_DEFAULTS_PROVIDER=moonshot the provider is correctly
resolved regardless of model name.

https://claude.ai/code/session_019vXaqxGmkdCjM8m3jp6rYj
This commit is contained in:
Claude 2026-02-18 04:13:00 +00:00
parent 6b3bc87783
commit f66f8be13c
No known key found for this signature in database

View file

@ -324,6 +324,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
model = "deepseek-chat"
}
}
case "moonshot", "kimi":
if cfg.Providers.Moonshot.APIKey != "" {
apiKey = cfg.Providers.Moonshot.APIKey
apiBase = cfg.Providers.Moonshot.APIBase
proxy = cfg.Providers.Moonshot.Proxy
if apiBase == "" {
apiBase = "https://api.moonshot.cn/v1"
}
}
case "github_copilot", "copilot":
if cfg.Providers.GitHubCopilot.APIBase != "" {
apiBase = cfg.Providers.GitHubCopilot.APIBase