fix(embed): skip profile .env overwrite when config has no HINDSIGHT_API_* keys (#896)
When the daemon is already running, ensure_running() calls _register_profile() with a config dict using short keys (llm_api_key, llm_provider, etc.) that do not match the HINDSIGHT_API_* prefix filter. This caused api_config to always be empty, and create_profile() would overwrite the existing .env with an empty file on every CLI command. Add an early return guard so _register_profile() skips the create_profile() call when api_config is empty, preserving any existing profile configuration. Fixes #894
This commit is contained in:
parent
e0e65c44f6
commit
9e2890ba81
1 changed files with 2 additions and 0 deletions
|
|
@ -419,6 +419,8 @@ class DaemonEmbedManager(EmbedManager):
|
|||
"""
|
||||
try:
|
||||
api_config = {k: v for k, v in config.items() if k.startswith("HINDSIGHT_API_")}
|
||||
if not api_config:
|
||||
return
|
||||
self._profile_manager.create_profile(profile, port, api_config)
|
||||
except Exception as e:
|
||||
logger.debug(f"Failed to register profile '{profile}' in metadata: {e}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue