fix(skills): handle bytes values in bundle_content_hash - #19081
Closed
shellybotmoyer wants to merge 1 commit into
Closed
fix(skills): handle bytes values in bundle_content_hash#19081shellybotmoyer wants to merge 1 commit into
shellybotmoyer wants to merge 1 commit into
Conversation
SkillBundle.files is Dict[str, Union[str, bytes]] but bundle_content_hash
unconditionally called .encode("utf-8") on every value, causing
AttributeError when the value is already bytes.
Fix: check isinstance(content, bytes) before encoding.
FixesNousResearch/hermes-agent#19073
Collaborator
Collaborator
This was referenced May 3, 2026
Contributor
|
The same bytes fix landed via #19575 (salvage of @teknium1's #19328, which was itself the canonical consolidation of five concurrent PRs — including yours). The logic you proposed is identical; thanks for catching and fixing this bug. Both contributors who implemented the same fix get credit via the commit's AUTHOR_MAP and this acknowledgement. Closing as duplicate. |
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.
Fix: Handle
bytesvalues inbundle_content_hashSkillBundle.filesis typed asDict[str, Union[str, bytes]]— dict values can be eitherstrorbytesdepending on how the bundle was loaded. However,bundle_content_hash()unconditionally called.encode("utf-8")on every value, causingAttributeError: 'bytes' object has no attribute 'encode'when the value was alreadybytes.Before:
After:
Fixes #19073