From a5c7422f23150095dcc37a27c5590aa058225244 Mon Sep 17 00:00:00 2001 From: Chris Danis Date: Wed, 22 Apr 2026 17:20:19 -0400 Subject: [PATCH] fix(hindsight): always write HINDSIGHT_LLM_API_KEY to .env, even when empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When user runs ✓ Memory provider: built-in only Saved to config.yaml and leaves the API key blank, the old code skipped writing it entirely. This caused the uvx daemon launcher to fail at startup because it couldn't distinguish between "key not configured" and "explicitly blank key." Now HINDSIGHT_LLM_API_KEY is always written to .env so the value is either set or explicitly empty. --- plugins/memory/hindsight/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/memory/hindsight/__init__.py b/plugins/memory/hindsight/__init__.py index 2b233e265..b3126a0b2 100644 --- a/plugins/memory/hindsight/__init__.py +++ b/plugins/memory/hindsight/__init__.py @@ -434,8 +434,10 @@ class HindsightMemoryProvider(MemoryProvider): sys.stdout.write(" LLM API key: ") sys.stdout.flush() llm_key = getpass.getpass(prompt="") if sys.stdin.isatty() else sys.stdin.readline().strip() - if llm_key: - env_writes["HINDSIGHT_LLM_API_KEY"] = llm_key + # Always write explicitly (including empty) so the provider sees "" + # rather than a missing variable. The daemon reads from .env at + # startup and fails when HINDSIGHT_LLM_API_KEY is unset. + env_writes["HINDSIGHT_LLM_API_KEY"] = llm_key # Step 4: Save everything provider_config["bank_id"] = "hermes"