diff --git a/agent/memory_manager.py b/agent/memory_manager.py index 27e90db579e63..5b57dd16f478c 100644 --- a/agent/memory_manager.py +++ b/agent/memory_manager.py @@ -562,10 +562,10 @@ class MemoryManager: # Propagate the caller's contextvars (profile HERMES_HOME override) # to the prefetch thread — see _submit_background. import contextvars + from functools import partial - _ctx = contextvars.copy_context() thread = threading.Thread( - target=lambda: _ctx.run(_run), + target=partial(contextvars.copy_context().run, _run), daemon=True, name=f"memory-prefetch-{provider.name}", ) @@ -743,9 +743,10 @@ class MemoryManager: from the worker would silently land on the default profile. """ import contextvars + from functools import partial ctx = contextvars.copy_context() - fn = (lambda inner: (lambda: ctx.run(inner)))(fn) + fn = partial(ctx.run, fn) executor = self._get_sync_executor() if executor is None: if self._shutting_down: diff --git a/plugins/memory/honcho/client.py b/plugins/memory/honcho/client.py index 9bc27ca23347d..42bb378c445f6 100644 --- a/plugins/memory/honcho/client.py +++ b/plugins/memory/honcho/client.py @@ -491,6 +491,7 @@ class HonchoClientConfig: api_key = get_secret("HONCHO_API_KEY") base_url = os.environ.get("HONCHO_BASE_URL", "").strip() or None timeout = _resolve_optional_float(os.environ.get("HONCHO_TIMEOUT")) + _resolved_path = resolve_config_path() return cls( host=resolved_host, workspace_id=workspace_id, @@ -500,6 +501,7 @@ class HonchoClientConfig: timeout=timeout, ai_peer=resolved_host, enabled=bool(api_key or base_url), + config_path=_resolved_path, hermes_home=get_hermes_home(), )