summaryrefslogtreecommitdiff
path: root/internal/hexailsp
diff options
context:
space:
mode:
Diffstat (limited to 'internal/hexailsp')
-rw-r--r--internal/hexailsp/run.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/hexailsp/run.go b/internal/hexailsp/run.go
index 0d488f0..366d71c 100644
--- a/internal/hexailsp/run.go
+++ b/internal/hexailsp/run.go
@@ -82,7 +82,11 @@ func buildClientIfNil(cfg appconfig.App, client llm.Client) llm.Client {
if strings.TrimSpace(oaKey) == "" {
oaKey = os.Getenv("OPENAI_API_KEY")
}
- cpKey := os.Getenv("COPILOT_API_KEY")
+ // Prefer HEXAI_COPILOT_API_KEY; fall back to COPILOT_API_KEY
+ cpKey := os.Getenv("HEXAI_COPILOT_API_KEY")
+ if strings.TrimSpace(cpKey) == "" {
+ cpKey = os.Getenv("COPILOT_API_KEY")
+ }
if c, err := llm.NewFromConfig(llmCfg, oaKey, cpKey); err != nil {
logging.Logf("lsp ", "llm disabled: %v", err)
return nil