fix(plugins): cap Honcho session name to 100 chars to prevent API errors (#13868)#15380
Open
Tranquil-Flow wants to merge 2 commits into
Open
fix(plugins): cap Honcho session name to 100 chars to prevent API errors (#13868)#15380Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
Collaborator
6bc830c to
364f8e0
Compare
364f8e0 to
b47c38c
Compare
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.
What does this PR do?
resolve_session_name()in the Honcho client sanitizes gateway session keys and other identifiers but applies no length truncation. Gateway session keys likeagent:main:telegram:group:-1001987654321:12345678:9876543210with peer prefixes can produce sanitized strings exceeding 100 characters. Honcho's API enforces a 100-character limit on session IDs, causing API errors.This PR caps the produced name to 100 characters at every return point.
Related Issue
Fixes #13868
Related: #13931
Type of Change
Changes Made
plugins/memory/honcho/client.py— added_MAX_SESSION_ID_LEN = 100constant and applied[:_MAX_SESSION_ID_LEN]truncation at all return points inresolve_session_name()— session title, gateway session key, per-session ID, per-repo name, per-directory name, global fallback, and peer-prefixed variants.tests/honcho_plugin/test_session_name_length.py— 6 targeted testsHow to Test
pytest tests/honcho_plugin/test_session_name_length.py -v— 6 tests covering:Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
N/A — see commit description and PR diff.