fix(memory): prefix Honcho gateway session key with ai_peer (#36160)#36820
fix(memory): prefix Honcho gateway session key with ai_peer (#36160)#36820TumCucTom wants to merge 3 commits into
Conversation
mxnstrexgl
left a comment
There was a problem hiding this comment.
🤖 Automated PR Review
Security Scan
- ✓ No hardcoded secrets, injection sinks, unsafe deserialization, or dependency red flags found by this automated scan.
Code Quality
- ✓ No blocking code-quality issues found by this automated scan.
Summary
Status: APPROVE — security findings: 0, quality suggestions: 0.
Automated review; raw diff content intentionally omitted.
|
Pushed a follow-up commit that adds my contributor email to `scripts/release.py` AUTHOR_MAP so the new `Contributor Attribution Check` CI workflow passes: ``` Locally verified against the new HEAD: ``` @maintainers — would you mind re-running the `check-attribution` job to confirm? The same fix is now on the other open PRs (#36931, #36943) and #36820. |
…arch#36160) When multiple Hermes profiles share one HERMES_HOME and a single chat, the gateway session key resolves identically for every profile, so all profiles collapse into one Honcho session. The other prefix branches (session_title, session_id, per-repo, per-directory) use `peer_name` (the human) as the prefix. That does not work for the gateway path — the human is shared per chat by definition. Use `ai_peer` (the profile-distinguishing side) instead, mirroring the existing pattern. No config change. Forward-compatible with the v0.15.x s6 architecture refactor. The hash passed to `_enforce_session_id_limit` is taken over the prefixed key so two profiles with the same chat get distinct truncated IDs when the limit is hit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The new contributor-check CI workflow requires every new committer email to be mapped to a GitHub username in scripts/release.py. Adds both known emails for the same contributor. Co-authored-by: Zippy AI <tomkinsbale@icloud.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b0bddf4 to
a3839ca
Compare
Summary
Closes #36160.
When multiple Hermes profiles share one
HERMES_HOMEand the same chat, the gateway session key resolves identically for every profile, so all profiles collapse into one Honcho session. The reporter confirmed in production that four profiles under one home all wrote to session IDagent-main-telegram-dm-6412607285.The other prefix branches in
resolve_session_name(session_title,session_id,per-repo,per-directory) usepeer_name(the human peer) as the prefix. That doesn't work for the gateway path — the human is shared per chat by definition. This PR usesai_peer(the profile-distinguishing side) instead, mirroring the existing pattern.What changed
plugins/memory/honcho/client.py:resolve_session_name()— gateway branch now prefixesgateway_session_keywithai_peerwhensession_peer_prefixis enabled, and passes the prefixed value to_enforce_session_id_limitso two profiles with the same chat get distinct truncated IDs if the 100-char Honcho limit is hit.tests/test_honcho_client_config.py— newTestHonchoGatewaySessionPrefixclass with three cases:test_gateway_session_key_unprefixed_by_default— preserves legacy behavior whensession_peer_prefix=Falsetest_gateway_session_key_prefixed_with_ai_peer_when_enabled— explicitai_peer="alpha"test_gateway_session_key_uses_default_ai_peer_hermes_when_enabled— out-of-the-box defaultWhat stayed the same
sessionPeerPrefixconfig knob and the existingai_peerattribute.session_peer_prefix=False) is byte-identical to before — single-profile deployments are unaffected.Test plan
All 54 tests pass (3 new + 51 pre-existing across the three test files).
Platforms tested
Related
session_titleintoMemoryProvider.initialize(). Did not address per-profile-within-chat.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com