From 507b84f2442eecf7422738b66dc29417870cda52 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 19 Aug 2025 23:28:03 +0300 Subject: config: apply HEXAI_* env even without config file; docs: clarify Copilot key; prefer HEXAI_COPILOT_API_KEY in builders --- internal/hexaicli/run.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/hexaicli/run.go') 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) } -- cgit v1.2.3