Skip to content

Fix Honcho auto-injection for shared gateway venues - #19833

Open
fadelguy wants to merge 1 commit into
NousResearch:mainfrom
fadelguy:fix/honcho-venue-summary-only
Open

Fix Honcho auto-injection for shared gateway venues#19833
fadelguy wants to merge 1 commit into
NousResearch:mainfrom
fadelguy:fix/honcho-venue-summary-only

Conversation

@fadelguy

@fadelguy fadelguy commented May 4, 2026

Copy link
Copy Markdown

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:

  • a trading thread could get school / Gmail / ops memory
  • shared venues could trigger unwanted initiative because stale global memory was injected as if it were relevant
  • session summaries stayed local, but the auto-injected peer context did not

Fix

This PR makes Honcho auto-injection venue-aware:

  • non-DM gateway venues now auto-inject session summary only
  • user representation / peer card / AI representation / AI card are no longer auto-injected there
  • dialectic prewarm + dialectic prefetch are skipped for those venues
  • Honcho context fetches now support summary_only=True, so we avoid fetching peer-global context when the policy does not allow it
  • DM / CLI behavior stays rich and unchanged

Tests

Added regression coverage for:

  • shared venues only auto-injecting session summaries
  • DM venues keeping richer auto-injection
  • shared venues skipping dialectic prefetch
  • Honcho session manager summary_only=True fetching only the session summary and skipping peer fetches

After 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.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/cli CLI entry point, hermes_cli/, setup wizard labels May 4, 2026
@fadelguy
fadelguy force-pushed the fix/honcho-venue-summary-only branch from ec0f240 to a61dc75 Compare May 4, 2026 19:11

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:186 introduces a stale peer-ID resolver. Current main's canonical resolver (plugins/memory/honcho/session.py:331-361) additionally handles user_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.

Comment thread plugins/memory/honcho/session.py Outdated
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 12, 2026
@fadelguy
fadelguy force-pushed the fix/honcho-venue-summary-only branch from a61dc75 to 7485c75 Compare July 13, 2026 20:31
@fadelguy

Copy link
Copy Markdown
Author

Thanks — salvaged this against current main in 7485c75c.

The updated branch now:

  • retains the canonical _resolve_user_peer_id() path and its runtime-ID alias/prefix/collision handling;
  • threads summary_only=True through the current asynchronous context-prefetch lifecycle;
  • skips dialectic prewarm/prefetch only for shared non-DM venues; and
  • excludes the unrelated observation/status changes from this salvage.

Added focused regression coverage for summary-only retrieval and shared-venue vs DM formatting. tests/honcho_plugin/test_session.py passes (121 tests), along with ruff and compile checks.

@teknium1 teknium1 added the area/memory Memory subsystem: store, providers, sync, background reviews label Jul 19, 2026
@fadelguy
fadelguy force-pushed the fix/honcho-venue-summary-only branch from 7485c75 to 38e9aed Compare August 4, 2026 05:15
@fadelguy

fadelguy commented Aug 4, 2026

Copy link
Copy Markdown
Author

Rebased and refreshed this PR against current main (head 38e9aed2c7).

The update preserves the shared-venue isolation policy through the current async prefetch lifecycle:

  • shared gateway venues inject only their session summary;
  • cached rich context is filtered before prompt formatting;
  • peer-global dialectic prewarm/prefetch is disabled in shared venues;
  • Honcho observation settings are scoped per session; and
  • internal memory-file / identity tags are stripped from visible output.

Verification: 73 passed across the focused Honcho and context-scrubber tests; ruff, py_compile, and git diff --check pass.

Could a maintainer please re-review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants