fix(honcho): truncate resolve_session_name output to Honcho's 100-char limit - #15357
Closed
erosika wants to merge 1 commit into
Closed
fix(honcho): truncate resolve_session_name output to Honcho's 100-char limit#15357erosika wants to merge 1 commit into
erosika wants to merge 1 commit into
Conversation
…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.
Contributor
Author
|
Superseded by #15381 (consolidated). |
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.
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.234/234 honcho_plugin tests pass locally.