Skip to content

The agent that grows with you

Merge remote-tracking branch 'origin/main' into ethie/pm-clean

ethernet063560696eeb
diff --cc hermes_cli/gateway_launchd.py
index 20094606c4b,09ff2720b0f..ae24089f4f9
--- a/hermes_cli/gateway_launchd.py
+++ b/hermes_cli/gateway_launchd.py
@@@ -611,11 -609,24 +616,25 @@@ def launchd_install(force: bool = False
if _gw()._refuse_temp_home_service_write(new_plist, "launchd plist"):
return
print(f"Installing launchd service to: {plist_path}")
+ _gw()._prepare_service_launcher()
plist_path.write_text(new_plist, encoding="utf-8")
+ if not load:
+ # A job left loaded but idle (a parked clean exit) keeps its old definition, and that is
+ # what `hermes gateway start` would kickstart instead of loading this plist.
+ subprocess.run(
+ ["launchctl", "bootout", f"{_gw()._launchd_domain()}/{label}"],
+ check=False, timeout=90, **_gw()._CAPTURE_TEXT)
+ print()
+ print("✓ Service installed, not started (launchd starts it at your next login)")
+ print()
+ print("Next steps:")
+ print(" hermes gateway start # Start it now")
+ print(" hermes gateway status # Check status")
+ return
+
try:
- _gw()._launchctl_bootstrap(_gw()._launchd_domain(), plist_path, _gw().get_launchd_label(), timeout=30)
+ _gw()._launchctl_bootstrap(_gw()._launchd_domain(), plist_path, label, timeout=30)
except subprocess.CalledProcessError as e:
_gw()._launchd_degrade_or_raise(e, "launchctl bootstrap")
return
diff --cc hermes_cli/memory_provider_migration.py
index 42ca8527f42,ebe3f461300..28ad6a6f50b
--- a/hermes_cli/memory_provider_migration.py
+++ b/hermes_cli/memory_provider_migration.py
@@@ -109,12 -109,16 +109,16 @@@ def migrate_all_homes(*, say: Callable[
def recover_at_startup(name: str) -> bool:
"""Agent-init hook for a configured provider that resolved nowhere. One attempt per process per
- name; honours ``security.allow_lazy_installs`` because it installs code. True when installed."""
- if name in _attempted:
+ home and name; honours ``security.allow_lazy_installs`` because it installs code. True when installed."""
+ from hermes_constants import get_hermes_home, hermes_home_key
+
+ home = get_hermes_home()
+ key = (hermes_home_key(home), name)
+ if key in _attempted:
return False
- _attempted.add(name)
+ _attempted.add(key)
- from tools.lazy_deps import _allow_lazy_installs
- if not _allow_lazy_installs():
+ from pm.install import lazy_installs_allowed
+ if not lazy_installs_allowed():
logger.warning("Memory provider '%s' is not installed; security.allow_lazy_installs is off — "
"run `hermes plugins install %s`.", name, name)
return False