summaryrefslogtreecommitdiff
path: root/internal/hexaicli/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/hexaicli/run.go')
-rw-r--r--internal/hexaicli/run.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/hexaicli/run.go b/internal/hexaicli/run.go
index 8cd5c82..14eff4f 100644
--- a/internal/hexaicli/run.go
+++ b/internal/hexaicli/run.go
@@ -88,7 +88,11 @@ func newClientFromConfig(cfg appconfig.App) (llm.Client, error) {
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")
+ }
return llm.NewFromConfig(llmCfg, oaKey, cpKey)
}