Fix Honcho auto-injection for shared gateway venues - #19833
Conversation
ec0f240 to
a61dc75
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the shared-venue recall problem. The premise still holds on current main: agent/agent_init.py:1366-1410 forwards chat_type, while Honcho still formats peer and AI context in plugins/memory/honcho/__init__.py:562-589, fetches it without venue filtering at :677-690, and runs dialectic at :695-768.
Problems
plugins/memory/honcho/session.py:186introduces a stale peer-ID resolver. Current main's canonical resolver (plugins/memory/honcho/session.py:331-361) additionally handlesuser_id_alt, configured aliases, runtime prefixes, and collision-safe generated IDs. Replacing it would regress the runtime identity mapping discussed as landed in #32863 / #30077.
Suggested changes
- During salvage, retain the summary-only and dialectic-skip policy but route stub/session peer resolution through current main's
_resolve_user_peer_id(key). - Adapt the policy to current main's asynchronous prefetch lifecycle (
plugins/memory/honcho/__init__.py:653-690) and split the unrelated observation/status changes unless they have a separate verified need.
Automated hermes-sweeper review.
| and bool(getattr(self._config, "peer_name", None)) | ||
| and getattr(self._config, "pin_peer_name", False) is True | ||
| ) | ||
| if self._runtime_user_peer_name and not pin_peer_name: |
There was a problem hiding this comment.
Please reuse the canonical peer resolver when salvaging this helper. Current main's _resolve_user_peer_id() also honors user_id_alt, userPeerAliases, runtimePeerPrefix, and collision-safe generated IDs; this older branch-local logic would drop those identity guarantees.
a61dc75 to
7485c75
Compare
|
Thanks — salvaged this against current main in 7485c75c. The updated branch now:
Added focused regression coverage for summary-only retrieval and shared-venue vs DM formatting. |
7485c75 to
38e9aed
Compare
|
Rebased and refreshed this PR against current The update preserves the shared-venue isolation policy through the current async prefetch lifecycle:
Verification: Could a maintainer please re-review? |
Problem
Honcho session isolation was already working at the gateway/session-key level, but shared gateway venues (Discord threads/channels, Telegram groups, Slack channels, etc.) still received global peer recall during auto-injection. That meant a public/shared venue could pull in user cards, user representations, AI identity context, and dialectic supplements that belonged to the user globally rather than to the current venue.
In practice this caused cross-thread / cross-venue contamination:
Fix
This PR makes Honcho auto-injection venue-aware:
summary_only=True, so we avoid fetching peer-global context when the policy does not allow itTests
Added regression coverage for:
summary_only=Truefetching only the session summary and skipping peer fetchesAfter this change
Shared/public venues behave like venue-local conversations instead of semi-global memory sinks. Threads keep their own session continuity, but they stop auto-pulling unrelated user-global memory from other threads, channels, and workflows.