compat(honcho): accept metadata kwarg on on_memory_write ABC bump
main's 6a957a74 added an optional 'metadata' kwarg to
MemoryProvider.on_memory_write so providers can distinguish tool-driven
memory writes from background-review writes. MemoryManager already
does a getfullargspec-based introspection, so the old 3-arg signature
didn't break at runtime — but it missed the origin hint entirely.
Updates HonchoMemoryProvider.on_memory_write to accept the kwarg. The
metadata isn't yet threaded into Honcho's create_conclusion payload —
that's worth its own PR once the consolidation lands and the new
metadata shape stabilises.
This commit is contained in:
@@ -1090,8 +1090,20 @@ class HonchoMemoryProvider(MemoryProvider):
|
|||||||
)
|
)
|
||||||
self._sync_thread.start()
|
self._sync_thread.start()
|
||||||
|
|
||||||
def on_memory_write(self, action: str, target: str, content: str) -> None:
|
def on_memory_write(
|
||||||
"""Mirror built-in user profile writes as Honcho conclusions."""
|
self,
|
||||||
|
action: str,
|
||||||
|
target: str,
|
||||||
|
content: str,
|
||||||
|
metadata: Optional[Dict[str, Any]] = None,
|
||||||
|
) -> None:
|
||||||
|
"""Mirror built-in user profile writes as Honcho conclusions.
|
||||||
|
|
||||||
|
``metadata`` is accepted for compatibility with the write-origin
|
||||||
|
work landed in main (commit 6a957a74); it's not yet threaded into
|
||||||
|
the Honcho conclusion payload. Left as a follow-up so this PR
|
||||||
|
stays focused on the 7-PR consolidation and its review follow-ups.
|
||||||
|
"""
|
||||||
if action != "add" or target != "user" or not content:
|
if action != "add" or target != "user" or not content:
|
||||||
return
|
return
|
||||||
if self._cron_skipped:
|
if self._cron_skipped:
|
||||||
|
|||||||
Reference in New Issue
Block a user