feat(memory): unify owner identity across channels in Honcho#9308
Open
handsdiff wants to merge 3 commits into
Open
feat(memory): unify owner identity across channels in Honcho#9308handsdiff wants to merge 3 commits into
handsdiff wants to merge 3 commits into
Conversation
c66a947 to
c95f69b
Compare
19 tasks
c95f69b to
81bc7fa
Compare
81bc7fa to
bb90d29
Compare
… memory
Cron-triggered agents had zero memory — skip_memory=True meant Honcho
and Hindsight were both disabled, so self-reflection crons couldn't read
prior self-reflections and hub-discovery crons couldn't remember what
they'd already found.
Route each cron job to its own Honcho peer (cron-{job_name}) so Honcho
builds a coherent representation per scheduled behavior. The assistant
peer still accumulates all actions into the agent's unified self-model.
Changes:
- Remove skip_memory=True from cron AIAgent construction, pass
user_id="cron-{slug(name)}" to route to per-job peers
- Add agent.shutdown_memory_provider() to cron teardown so final
sync_turn/aretain_batch writes aren't dropped
- Delete the _cron_skipped guard from HonchoMemoryProvider (flag init,
cron/flush check in initialize(), and 9 early-return checks)
- Add skip_memory=True to the hygiene compress agent, which was
accidentally protected by the cron guard but should never write
to memory providers
- Revert NousResearch#6995 peerName guard (not cfg.peer_name) that blocked ALL
user_id overrides on provisioned agents — cron peers, stranger
isolation, and future owner-unification all depend on the override
being unconditional
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner messages from different channels (Telegram, Discord, CLI, etc.)
were each creating separate Honcho peers, fragmenting the owner's
representation. The agent couldn't remember cross-channel conversations.
Add gateway-side owner detection so the configured peerName ("user")
survives for owner sources while strangers still get transport-level
peer isolation:
- Add _is_owner_source helper with strict DM-only check, untrusted
platform exclusion (webhook, API server), and chat_id match against
home channels
- At both memory-participating AIAgent construction sites, pass
user_id=None for owner sources so the honcho plugin's unconditional
override doesn't fire, letting peerName: "user" survive
- Set chat_type="synthetic" on the background process notification's
synthetic SessionSource to prevent false-positive owner detection
- Thread legacy_peer_ids through AIAgent → memory init → honcho plugin
for dual-read of pre-unification transport-level peer representations
- Extend get_prefetch_context to fetch legacy peer contexts and merge
into first-turn context as "Prior Channel History" so existing owner
history isn't orphaned after unification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bb90d29 to
e6f978e
Compare
Cyrene963
pushed a commit
to Cyrene963/hermes-agent
that referenced
this pull request
May 3, 2026
…cation Adds command that: 1. Reads config.yaml to find Telegram home channel chat_id 2. Falls back to largest memory directory detection 3. Automatically migrates data and creates symlinks 4. Sets up global MEMORY.md/USER.md for CLI access Addresses feedback on NousResearch#9308 overlap: - NousResearch#9308 auto-detects owner at gateway layer (Honcho only) - This provides auto-setup for owner + manual mapping for any user - Works with all memory providers, not just Honcho Commands: auto-setup, map, unmap, list, resolve, migrate
Cyrene963
pushed a commit
to Cyrene963/hermes-agent
that referenced
this pull request
May 7, 2026
…cation Adds command that: 1. Reads config.yaml to find Telegram home channel chat_id 2. Falls back to largest memory directory detection 3. Automatically migrates data and creates symlinks 4. Sets up global MEMORY.md/USER.md for CLI access Addresses feedback on NousResearch#9308 overlap: - NousResearch#9308 auto-detects owner at gateway layer (Honcho only) - This provides auto-setup for owner + manual mapping for any user - Works with all memory providers, not just Honcho Commands: auto-setup, map, unmap, list, resolve, migrate
This was referenced May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_is_owner_source) so the provisioner's configuredpeerName: "user"survives for owner sources, while strangers still get isolated transport-level peersDetail
Owner detection
New
_is_owner_sourcehelper onGatewayRunnerwith intentionally conservative checks:chat_type == "dm"(group home channels fall through)chat_idmust match the platform's configured home channelAt both memory-participating
AIAgentconstruction sites, passesuser_id=Nonefor recognized owner sources. The honcho plugin's unconditionaluser_idoverride (restored by #9287) doesn't fire, sopeerName: "user"from honcho.json survives → all owner DMs land on the same peer.Dual-read for orphaned history
Without dual-read, the first post-deploy owner message would see an empty
userrepresentation (all history is under transport-level peers liketelegram-12345). The gateway computeslegacy_peer_idsfrom home channel chat_ids and threads them through toget_prefetch_context, which fetches those peers' representations and merges them into the first-turn context as "Prior Channel History."Synthetic source fix
Background process completion notifications create a synthetic
SessionSourcewithoutchat_type(defaults to "dm"). Setchat_type="synthetic"to prevent false-positive owner detection.Depends on
feat/cron-memory-peers) — restores the unconditionaluser_idoverride that this PR's mechanism relies onTest plan
userusernot polluteduserrepresentation and legacy peer historychat_type="synthetic")/sethomebootstrap: pre-sethome message on transport peer, post-sethome onuser, dual-read surfaces both🤖 Generated with Claude Code