Bug Description
In local_embedded mode, DaemonEmbedManager.ensure_running() spawns the per-profile daemon detached, so env vars exported in the parent shell (e.g. HINDSIGHT_API_LLM_API_KEY) are not inherited. The only reliable way to pass the key is via the config dict (llm_api_key) passed to ensure_running.
Steps to Reproduce
- export HINDSIGHT_API_LLM_API_KEY= in the shell
- In Python: get_embed_manager().ensure_running(cfg, profile) for a profile with a queued reflect/mental-model job (cfg has no llm_api_key)
- Observe daemon log / startup result
Expected Behavior
The daemon inherits the parent process env (or, if the detached design is intentional, the error message names the missing config key rather than an env var that can never reach the daemon, and the local_embedded docs state the contract).
Actual Behavior
Daemon crashes at boot with "ValueError: LLM API key is required. Set HINDSIGHT_API_LLM_API_KEY environment variable." despite that env var being set in the parent shell, and ensure_running just times out (~178s). Profiles with no LLM call at boot start fine without the key, so the setup looks healthy until one profile fails — masking the cause.
Version
0.9.0 (hindsight-all / hindsight-api-slim / hindsight-embed; hermes-agent 0.19.0)
LLM Provider
OpenAI-compatible
Bug Description
In local_embedded mode, DaemonEmbedManager.ensure_running() spawns the per-profile daemon detached, so env vars exported in the parent shell (e.g. HINDSIGHT_API_LLM_API_KEY) are not inherited. The only reliable way to pass the key is via the config dict (llm_api_key) passed to ensure_running.
Steps to Reproduce
Expected Behavior
The daemon inherits the parent process env (or, if the detached design is intentional, the error message names the missing config key rather than an env var that can never reach the daemon, and the local_embedded docs state the contract).
Actual Behavior
Daemon crashes at boot with "ValueError: LLM API key is required. Set HINDSIGHT_API_LLM_API_KEY environment variable." despite that env var being set in the parent shell, and ensure_running just times out (~178s). Profiles with no LLM call at boot start fine without the key, so the setup looks healthy until one profile fails — masking the cause.
Version
0.9.0 (hindsight-all / hindsight-api-slim / hindsight-embed; hermes-agent 0.19.0)
LLM Provider
OpenAI-compatible