Skip to content

fix(honcho): truncate resolve_session_name output to Honcho's 100-char limit - #15357

Closed
erosika wants to merge 1 commit into
NousResearch:mainfrom
erosika:fix/honcho-session-id-100char-truncation
Closed

fix(honcho): truncate resolve_session_name output to Honcho's 100-char limit#15357
erosika wants to merge 1 commit into
NousResearch:mainfrom
erosika:fix/honcho-session-id-100char-truncation

Conversation

@erosika

@erosika erosika commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Adopts #13931 by @Sanjays2402 with original authorship preserved.

Fixes #13868.

Long gateway session keys (Matrix !room:server + thread event IDs, Telegram supergroup reply chains, long Slack thread IDs) overflow Honcho's 100-char session_id limit after sanitization; every API call for those sessions then 400s with "session_id too long".

Over-limit keys get a prefix + -<sha256:8> suffix so long keys sharing a prefix don't collide onto the same truncated ID. Short keys (the common case) short-circuit unchanged.

  • plugins/memory/honcho/client.py: +35 -1
  • tests/honcho_plugin/test_client.py: +77 (7 new tests)

234/234 honcho_plugin tests pass locally.

…r limit (NousResearch#13868)

Gateway session keys (Matrix "!room:server" + thread event IDs, Telegram
supergroup reply chains, Slack thread IDs with long workspace prefixes) can
exceed Honcho's 100-character session ID limit after sanitization. Every
Honcho API call for those sessions then 400s with "session_id too long".

Add a helper that enforces the 100-char limit after sanitization:
short keys (the common case) short-circuit unchanged; over-limit keys
keep a prefix and append a deterministic `-<8 hex>` SHA-256 suffix over
the original key so two long keys sharing a leading segment can't
collide onto the same truncated ID.

Adds 7 regression tests in tests/honcho_plugin/test_client.py covering
short / exact-limit / long / deterministic / collision-resistant /
allowlist-preserving / hash-suffix-present cases.
@erosika

erosika commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #15381 (consolidated).

@erosika erosika closed this Apr 24, 2026
@erosika
erosika deleted the fix/honcho-session-id-100char-truncation branch April 24, 2026 22:11
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/plugins Plugin system and bundled plugins labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: resolve_session_name sanitizes gateway_session_key without length truncation, overflows Honcho's 100-char session ID limit

3 participants