Skip to content

The agent that grows with you

fix: replace double-lambda with functools.partial, close from_env config_path gap

kshitij5118692c2567
diff --git a/agent/memory_manager.py b/agent/memory_manager.py
index 27e90db579e..5b57dd16f47 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 9bc27ca2334..42bb378c445 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(),
)