summaryrefslogtreecommitdiff
path: root/internal/hexailsp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-19 23:28:03 +0300
committerPaul Buetow <paul@buetow.org>2025-08-19 23:28:03 +0300
commit507b84f2442eecf7422738b66dc29417870cda52 (patch)
tree4daa19839a4cf237f1eb3254889dd20246519180 /internal/hexailsp
parentfd8e2fe8177305c9271d12c90cc6ad2ed73a1673 (diff)
config: apply HEXAI_* env even without config file; docs: clarify Copilot key; prefer HEXAI_COPILOT_API_KEY in builders
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