From 12a249282d5dd9dc2ee1e66f08d6acc26dd29eba Mon Sep 17 00:00:00 2001 From: "paul@buetow.org" Date: Fri, 6 Feb 2026 16:35:45 +0200 Subject: 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 --- PR.md | 1 - README.md | 2 +- cmd/hexai/main.go | 4 +- config.toml.example | 11 +- docs/configuration.md | 8 +- docs/coverage.html | 9825 ----- docs/coverage.out | 53649 ++++++++++++++------------ internal/appconfig/config.go | 51 +- internal/appconfig/config_env_model_test.go | 8 +- internal/appconfig/config_test.go | 41 +- internal/hexaiaction/prompts.go | 4 +- internal/hexaiaction/prompts_more_test.go | 4 +- internal/hexaiaction/run_more_test.go | 2 +- internal/hexaicli/run.go | 8 +- internal/hexaicli/run_test.go | 20 +- internal/hexaicli/testhelpers_test.go | 1 - internal/hexailsp/run.go | 10 +- internal/llm/copilot.go | 412 - internal/llm/copilot_http_test.go | 276 - internal/llm/copilot_test.go | 35 - internal/llm/openai_temp_test.go | 6 +- internal/llm/provider.go | 15 +- internal/llm/provider_more2_test.go | 12 - internal/llm/provider_more_test.go | 10 +- internal/llm/provider_test.go | 8 +- internal/llmutils/client.go | 9 +- internal/lsp/handlers_utils.go | 2 - internal/lsp/llm_request_opts_test.go | 8 +- internal/lsp/server.go | 15 +- internal/runtimeconfig/store_test.go | 4 +- 30 files changed, 29303 insertions(+), 35158 deletions(-) delete mode 100644 docs/coverage.html delete mode 100644 internal/llm/copilot.go delete mode 100644 internal/llm/copilot_http_test.go delete mode 100644 internal/llm/copilot_test.go delete mode 100644 internal/llm/provider_more2_test.go diff --git a/PR.md b/PR.md index 50a5393..686c7ab 100644 --- a/PR.md +++ b/PR.md @@ -36,7 +36,6 @@ export HEXAI_REQUEST_TIMEOUT=120 - `internal/llm/openai.go` - Added `newOpenAIWithTimeout` - `internal/llm/ollama.go` - Added `newOllamaWithTimeout` - `internal/llm/openrouter.go` - Added `newOpenRouterWithTimeout` -- `internal/llm/copilot.go` - Added `newCopilotWithTimeout` - `internal/llm/anthropic.go` - Added `newAnthropicWithTimeout` - `internal/hexailsp/run.go` - Pass `RequestTimeout` to `llm.Config` - `internal/llmutils/client.go` - Pass `RequestTimeout` to `llm.Config` diff --git a/README.md b/README.md index 4ffc0ef..88ee031 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It has got improved capabilities for Go code understanding (for example, create * Parallel completions and CLI responses from multiple providers/models for side-by-side comparison * TUI AI code-action runner (`hexai-tmux-action`) with Bubble Tea - Includes a “Custom prompt” action (hotkey `p`) that opens your editor (`$HEXAI_EDITOR` or `$EDITOR`) on a temporary Markdown file. -* Support for OpenAI, OpenRouter, GitHub Copilot, Anthropic, and Ollama +* Support for OpenAI, OpenRouter, Anthropic, and Ollama ## Documentation diff --git a/cmd/hexai/main.go b/cmd/hexai/main.go index 7caedc6..15fda42 100644 --- a/cmd/hexai/main.go +++ b/cmd/hexai/main.go @@ -100,8 +100,8 @@ func pickDefaultModel(cfg appconfig.App, provider string) string { switch strings.ToLower(strings.TrimSpace(provider)) { case "ollama": return strings.TrimSpace(cfg.OllamaModel) - case "copilot": - return strings.TrimSpace(cfg.CopilotModel) + case "anthropic": + return strings.TrimSpace(cfg.AnthropicModel) default: return strings.TrimSpace(cfg.OpenAIModel) } diff --git a/config.toml.example b/config.toml.example index cc34e04..bb8165d 100644 --- a/config.toml.example +++ b/config.toml.example @@ -52,8 +52,8 @@ chat_prefixes = ["?", "!", ":", ";"] # single-character items # [[models.code_action]] # # Only the first entry is used; extras are ignored with a warning. -# provider = "copilot" -# model = "gpt-4o" +# provider = "anthropic" +# model = "claude-3-5-sonnet" # temperature = 0.4 # [[models.cli]] @@ -62,7 +62,7 @@ chat_prefixes = ["?", "!", ":", ";"] # single-character items # temperature = 0.6 [provider] -name = "openai" # openai | openrouter | copilot | ollama | anthropic +name = "openai" # openai | openrouter | anthropic | ollama [openai] model = "gpt-4.1" @@ -74,11 +74,6 @@ model = "openrouter/auto" base_url = "https://openrouter.ai/api/v1" temperature = 0.2 -[copilot] -model = "gpt-4o-mini" -base_url = "https://api.githubcopilot.com" -temperature = 0.2 - [ollama] model = "qwen3-coder:30b-a3b-q4_K_M" base_url = "http://localhost:11434" diff --git a/docs/configuration.md b/docs/configuration.md index 54ac85f..f4469a9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -20,7 +20,6 @@ Environment overrides - `HEXAI_CHAT_SUFFIX`, `HEXAI_CHAT_PREFIXES` (comma-separated) - `HEXAI_OPENAI_MODEL`, `HEXAI_OPENAI_BASE_URL`, `HEXAI_OPENAI_TEMPERATURE` - `HEXAI_OPENROUTER_MODEL`, `HEXAI_OPENROUTER_BASE_URL`, `HEXAI_OPENROUTER_TEMPERATURE` - - `HEXAI_COPILOT_MODEL`, `HEXAI_COPILOT_BASE_URL`, `HEXAI_COPILOT_TEMPERATURE` - `HEXAI_OLLAMA_MODEL`, `HEXAI_OLLAMA_BASE_URL`, `HEXAI_OLLAMA_TEMPERATURE` - Per-surface overrides: `HEXAI_MODEL_COMPLETION`, `HEXAI_MODEL_CODE_ACTION`, `HEXAI_MODEL_CHAT`, `HEXAI_MODEL_CLI` - Per-surface temperatures: `HEXAI_TEMPERATURE_COMPLETION`, `HEXAI_TEMPERATURE_CODE_ACTION`, `HEXAI_TEMPERATURE_CHAT`, `HEXAI_TEMPERATURE_CLI` @@ -37,7 +36,7 @@ Per-surface models [models.code_action] model = "gpt-4o" - provider = "copilot" + provider = "openai" temperature = 0.4 [models.cli] @@ -47,7 +46,7 @@ Per-surface models - Repeating the table (`[[models.]]`) configures multiple provider/model pairs. Completion requests and the Hexai CLI fan out to every configured entry concurrently and label the responses with `provider:model`. Code actions continue to use the first entry only; any extra [[models.code_action]] tables are ignored at runtime and the loader logs a warning so you know an additional entry was skipped. -- When a per-surface value is omitted, Hexai falls back to the provider’s configured default. Temperatures inherit from `coding_temperature` unless explicitly set, and OpenAI `gpt-5*` models automatically raise an unspecified coding temperature to `1.0` for exploratory behavior. Provider overrides support `"openai"`, `"openrouter"`, `"copilot"`, or `"ollama"` and read the matching credential variables. +- When a per-surface value is omitted, Hexai falls back to the provider’s configured default. Temperatures inherit from `coding_temperature` unless explicitly set, and OpenAI `gpt-5*` models automatically raise an unspecified coding temperature to `1.0` for exploratory behavior. Provider overrides support `"openai"`, `"openrouter"`, `"anthropic"`, or `"ollama"` and read the matching credential variables. Runtime reloads @@ -61,11 +60,10 @@ API keys: - OpenAI: prefer `HEXAI_OPENAI_API_KEY`, falling back to `OPENAI_API_KEY`. - OpenRouter: prefer `HEXAI_OPENROUTER_API_KEY`, falling back to `OPENROUTER_API_KEY`. -- Copilot: prefer `HEXAI_COPILOT_API_KEY`, falling back to `COPILOT_API_KEY`. Selecting a provider -- Sectioned: set `[provider] name = "openai" | "openrouter" | "copilot" | "ollama"`. +- Sectioned: set `[provider] name = "openai" | "openrouter" | "anthropic" | "ollama"`. - If omitted, Hexai defaults to `openai`. - Selecting `openrouter` uses https://openrouter.ai/api/v1 by default and automatically sends the required `HTTP-Referer` (`https://github.com/snonux/hexai`) and `X-Title` (`Hexai`) headers. Override the base URL via `[openrouter]` or environment variables when needed. diff --git a/docs/coverage.html b/docs/coverage.html deleted file mode 100644 index 4526ad1..0000000 --- a/docs/coverage.html +++ /dev/null @@ -1,9825 +0,0 @@ - - - - - - hexai-lsp: Go Coverage Report - - - -
- -
- not tracked - - no coverage - low coverage - * - * - * - * - * - * - * - * - high coverage - -
-
-
- - - - - - - -