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"