diff options
| author | paul@buetow.org <paul@buetow.org> | 2026-02-06 16:35:45 +0200 |
|---|---|---|
| committer | paul@buetow.org <paul@buetow.org> | 2026-02-06 16:35:45 +0200 |
| commit | 12a249282d5dd9dc2ee1e66f08d6acc26dd29eba (patch) | |
| tree | 5e9ae4fbd1696d1b668dfe0be791004a87fc7a6a /internal/lsp | |
| parent | 89dc2aab0b6be2620766a4b4b750fa888641b89d (diff) | |
Remove GitHub Copilot provider support
Remove all GitHub Copilot integration from the codebase to streamline
the supported provider set to OpenAI, OpenRouter, Anthropic, and Ollama.
Changes:
- Delete core Copilot implementation (copilot.go) and all related tests
- Remove Copilot configuration fields from App struct and Config
- Remove Copilot from provider factory and API key handling
- Update all test files to replace Copilot references with other providers
- Remove Copilot documentation from README, configuration guide, and examples
- Remove Copilot section from config.toml.example
All tests pass successfully after removal.
Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'internal/lsp')
| -rw-r--r-- | internal/lsp/handlers_utils.go | 2 | ||||
| -rw-r--r-- | internal/lsp/llm_request_opts_test.go | 8 | ||||
| -rw-r--r-- | internal/lsp/server.go | 15 |
3 files changed, 5 insertions, 20 deletions
diff --git a/internal/lsp/handlers_utils.go b/internal/lsp/handlers_utils.go index 6260acd..1ea36c8 100644 --- a/internal/lsp/handlers_utils.go +++ b/internal/lsp/handlers_utils.go @@ -110,8 +110,6 @@ func resolveDefaultModel(cfg appconfig.App, provider string) string { switch provider { case "ollama": return strings.TrimSpace(cfg.OllamaModel) - case "copilot": - return strings.TrimSpace(cfg.CopilotModel) case "anthropic": return strings.TrimSpace(cfg.AnthropicModel) case "openrouter": diff --git a/internal/lsp/llm_request_opts_test.go b/internal/lsp/llm_request_opts_test.go index f4d31b9..ad87cd4 100644 --- a/internal/lsp/llm_request_opts_test.go +++ b/internal/lsp/llm_request_opts_test.go @@ -44,10 +44,10 @@ func TestBuildRequestSpecs_MultiEntries(t *testing.T) { s := newTestServer() s.cfg.CompletionConfigs = []appconfig.SurfaceConfig{ {Provider: "openai", Model: "gpt-4o"}, - {Provider: "copilot", Model: "cpt", Temperature: floatPtr(0.4)}, + {Provider: "anthropic", Model: "claude", Temperature: floatPtr(0.4)}, } s.cfg.OpenAIModel = "gpt-3.5" - s.cfg.CopilotModel = "cpt-base" + s.cfg.AnthropicModel = "claude-base" s.cfg.MaxTokens = 256 specs := s.buildRequestSpecs(surfaceCompletion) if len(specs) != 2 { @@ -56,7 +56,7 @@ func TestBuildRequestSpecs_MultiEntries(t *testing.T) { if specs[0].provider != "openai" || specs[0].index != 0 { t.Fatalf("unexpected first spec: %+v", specs[0]) } - if specs[1].provider != "copilot" || specs[1].index != 1 { + if specs[1].provider != "anthropic" || specs[1].index != 1 { t.Fatalf("unexpected second spec: %+v", specs[1]) } var opts1, opts2 llm.Options @@ -69,7 +69,7 @@ func TestBuildRequestSpecs_MultiEntries(t *testing.T) { if opts1.Model != "gpt-4o" || opts1.MaxTokens != 256 { t.Fatalf("unexpected opts1: %+v", opts1) } - if opts2.Model != "cpt" || opts2.Temperature != 0.4 { + if opts2.Model != "claude" || opts2.Temperature != 0.4 { t.Fatalf("unexpected opts2: %+v", opts2) } } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index bbee64f..c226ab4 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -230,9 +230,6 @@ func newClientForProvider(cfg appconfig.App, provider string) (llm.Client, error OllamaBaseURL: cfg.OllamaBaseURL, OllamaModel: cfg.OllamaModel, OllamaTemperature: cfg.OllamaTemperature, - CopilotBaseURL: cfg.CopilotBaseURL, - CopilotModel: cfg.CopilotModel, - CopilotTemperature: cfg.CopilotTemperature, AnthropicBaseURL: cfg.AnthropicBaseURL, AnthropicModel: cfg.AnthropicModel, AnthropicTemperature: cfg.AnthropicTemperature, @@ -245,15 +242,11 @@ func newClientForProvider(cfg appconfig.App, provider string) (llm.Client, error if orKey == "" { orKey = strings.TrimSpace(os.Getenv("OPENROUTER_API_KEY")) } - cpKey := strings.TrimSpace(os.Getenv("HEXAI_COPILOT_API_KEY")) - if cpKey == "" { - cpKey = strings.TrimSpace(os.Getenv("COPILOT_API_KEY")) - } anKey := strings.TrimSpace(os.Getenv("HEXAI_ANTHROPIC_API_KEY")) if anKey == "" { anKey = strings.TrimSpace(os.Getenv("ANTHROPIC_API_KEY")) } - return llm.NewFromConfig(llmCfg, oaKey, orKey, cpKey, anKey) + return llm.NewFromConfig(llmCfg, oaKey, orKey, anKey) } func (s *Server) clientFor(spec requestSpec) llm.Client { @@ -296,12 +289,6 @@ func (s *Server) clientFor(spec requestSpec) llm.Client { } else if spec.fallbackModel != "" { cfg.OpenRouterModel = spec.fallbackModel } - case "copilot": - if modelOverride != "" { - cfg.CopilotModel = modelOverride - } else if spec.fallbackModel != "" { - cfg.CopilotModel = spec.fallbackModel - } case "ollama": if modelOverride != "" { cfg.OllamaModel = modelOverride |
