feat(memory): per-job Honcho peers for cron-triggered agents#9287
Open
handsdiff wants to merge 1 commit into
Open
feat(memory): per-job Honcho peers for cron-triggered agents#9287handsdiff wants to merge 1 commit into
handsdiff wants to merge 1 commit into
Conversation
8 tasks
f357e79 to
1118f9c
Compare
1118f9c to
88e51ed
Compare
88e51ed to
2dac700
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>
2dac700 to
2b47a5e
Compare
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
skip_memory=True), so scheduled behaviors like self-reflection and hub-discovery have zero persistence across runscron-{job_name}) instead of the human owner's peer, giving each scheduled behavior a coherent representation while the assistant's unified self-model accumulates all cron actionsnot cfg.peer_nameguard that silently blocked alluser_idoverrides on provisioned agents (wherepeerName: "user"is configured), fixing active stranger pollution and unblocking cron peer routingskip_memory=Trueto the hygiene compress agent, which was accidentally protected by the now-removed cron guard but should never write to memory providersagent.shutdown_memory_provider()to the cron teardown path so finalsync_turn/aretain_batchwrites aren't silently droppedDetail
Why per-job peers (not one global cron peer)
Cron behaviors are semantically distinct —
self-reflection,hub-discovery,morning-brief, etc. A single peer accumulating all of them would produce an incoherent representation. Each named job gets its own peer with a readable ID derived from the job name.Why revert #6995's peerName guard
The guard (
if _gw_user_id and not cfg.peer_name) was intended to prevent raw transport IDs from overwriting an explicitly configuredpeerName. But on provisioned agents wherepeerName: "user"is set, it blocks alluser_idoverrides — including cron peer routing and stranger isolation. This causes two bugs:user_id="cron-self-reflection"is silently ignored → cron messages land on the owner'suserpeeruserinstead of their own transport-level peerThe fix moves identity protection to the gateway layer (where caller context is available) rather than the plugin layer. Owner fragmentation temporarily returns to pre-#6995 behavior until the gateway-side owner detection ships as a follow-up.
Hindsight
Hindsight has no cron guard — when
skip_memory=Trueis removed, it activates automatically and begins retaining cron turns. Each run stores under its owndocument_id(thecron_{job_id}_{timestamp}session ID), so runs are naturally distinct. No hindsight-specific changes needed.Test plan
cron-{name}peers appear in Honcho workspace with per-job representationsuser)document_idpatternshutdown_memory_provider()runs cleanly in cron teardown (no dropped writes in logs)_hyg_agentdoes not create Honcho peers or Hindsight documents🤖 Generated with Claude Code