diff options
| author | paul@buetow.org <paul@buetow.org> | 2026-02-06 16:15:29 +0200 |
|---|---|---|
| committer | paul@buetow.org <paul@buetow.org> | 2026-02-06 16:15:29 +0200 |
| commit | fbfbc3311e7c5beee35f430a443866bc30cf595f (patch) | |
| tree | 8b1dd63e4d1d1112b1ef28b71b61a27df16d9f68 /internal/lsp/handlers_utils.go | |
| parent | da01d65da337cc2f6c99d8236140f8fb45c6bd5e (diff) | |
fix: add missing Anthropic and OpenRouter provider support in config and LSP
- Add Anthropic field merging in config.mergeProviderFields() to properly load AnthropicModel/BaseURL/Temperature from config.toml
- Add anthropic and openrouter cases in lsp.resolveDefaultModel() to prevent fallback to OpenAI defaults
- Update default Anthropic model to valid claude-3-5-sonnet-20240620 (previous 20241022 doesn't exist)
- Update test expectation to match new default model
This fixes the issue where Anthropic provider configuration was ignored, causing LSP to return dummy completions instead of real LLM responses.
Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'internal/lsp/handlers_utils.go')
| -rw-r--r-- | internal/lsp/handlers_utils.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/lsp/handlers_utils.go b/internal/lsp/handlers_utils.go index 10cc739..6260acd 100644 --- a/internal/lsp/handlers_utils.go +++ b/internal/lsp/handlers_utils.go @@ -31,7 +31,6 @@ type requestSpec struct { index int } - func (r requestSpec) effectiveModel(defaultModel string) string { if m := strings.TrimSpace(r.entry.Model); m != "" { return m @@ -113,6 +112,10 @@ func resolveDefaultModel(cfg appconfig.App, provider string) string { return strings.TrimSpace(cfg.OllamaModel) case "copilot": return strings.TrimSpace(cfg.CopilotModel) + case "anthropic": + return strings.TrimSpace(cfg.AnthropicModel) + case "openrouter": + return strings.TrimSpace(cfg.OpenRouterModel) default: return strings.TrimSpace(cfg.OpenAIModel) } |
