Files
Nicolò Boschi 7eb0fcc616 fix(embed): forward every HINDSIGHT_* var to the daemon instead of a whitelist (#4094) (#4119)
A profile .env that set HINDSIGHT_API_LLM_BASE_URL alongside KEY/MODEL was
reported as having everything applied except the base URL, so LLM calls went to
api.openai.com and failed with OpenAI's own 401.

The propagation path itself was fine, but the same six settings were hardcoded
in four separate lists, and a setting had to appear in all of them to survive:
lowercase aliases injected by load_profile_config, mapped back by the daemon
manager, then stripped out again by the control center and by _register_profile.
get_config() carried three of them, which is why an exported base URL never
reached a profile written by `configure`.

Replace the lot with the name the setting already has:

- load_profile_config returns environment-variable names only
- the daemon forwards every HINDSIGHT_* key in the merged config verbatim
- get_config()/configure persist every HINDSIGHT_API_* var the caller set
- the control center reads the env names directly

An explicit "" is still forwarded, so blanking an inherited API key for an
unauthenticated local LLM keeps working (#3253). _register_profile is now
additive — it seeds keys a profile lacks and never rewrites configured ones, so
a one-off `HINDSIGHT_API_LLM_MODEL=... hindsight-embed recall` cannot rewrite
the user's profile now that the config it sees carries the ambient environment.

One behaviour change worth calling out: an exported HINDSIGHT_API_* variable now
wins over the profile's .env for the daemon. Previously the profile won, which
is why the reporter's workaround needed the daemon restarted to take effect.
2026-09-04 11:59:14 +02:00
..