Bug Description
When a user switches memory.provider from one provider to another (e.g., hindsight → openviking), the config deep-merge logic updates the top-level provider key but does not remove the old provider's sub-keys.
For example, after changing memory.provider from hindsight to openviking:
# Profile config.yaml (correctly updated)
memory:
provider: openviking
# But main config.yaml still has:
memory:
provider: hindsight # ← overridden by profile
hindsight: # ← stale sub-key NOT removed
base_url: http://localhost:36813
Deep merge result: provider=openviking (from profile) + hindsight.base_url (from main, stale). Some code paths that read main config for provider initialization probe the stale hindsight.base_url, attempt to connect to a non-existent service (port 36813), fail, and cause:
- Gateway WSS disconnections (
keepalive ping timeout)
- SIGTERM with exit code 1 (FAILURE)
- Automatic restart loops
Impact
Observed in production (20-profile deployment):
- Gateway WSS disconnected twice in 40 minutes after switching from hindsight to openviking
- Gateway crashed with exit code 1 and auto-restarted
- Root cause was stale
hindsight.base_url in main config.yaml that was never cleaned up
This affects any memory provider switch, not just hindsight → openviking.
Steps to Reproduce
- Configure
memory.provider: hindsight with hindsight.base_url in main config.yaml
- In a profile config, set
memory.provider: openviking
- Uninstall hindsight service (stop + disable)
- Restart gateway
- Observe WSS disconnections and gateway crashes
Expected Behavior
When memory.provider changes, the merge logic should either:
- Remove the old provider's sub-keys from the merged result
- Or warn the user about stale sub-keys
Workaround Applied
Manually remove stale hindsight sub-keys from main config.yaml.
Environment
- Hermes Agent: 0.18.0
- 20 profiles, switched from hindsight to openviking
Bug Description
When a user switches
memory.providerfrom one provider to another (e.g., hindsight → openviking), the config deep-merge logic updates the top-levelproviderkey but does not remove the old provider's sub-keys.For example, after changing
memory.providerfromhindsighttoopenviking:Deep merge result:
provider=openviking(from profile) +hindsight.base_url(from main, stale). Some code paths that read main config for provider initialization probe the stalehindsight.base_url, attempt to connect to a non-existent service (port 36813), fail, and cause:keepalive ping timeout)Impact
Observed in production (20-profile deployment):
hindsight.base_urlin main config.yaml that was never cleaned upThis affects any memory provider switch, not just hindsight → openviking.
Steps to Reproduce
memory.provider: hindsightwithhindsight.base_urlin mainconfig.yamlmemory.provider: openvikingExpected Behavior
When
memory.providerchanges, the merge logic should either:Workaround Applied
Manually remove stale
hindsightsub-keys from mainconfig.yaml.Environment