Skip to content

fix(skills): handle bytes in bundle content hash - #13531

Closed
zhao0112 wants to merge 1 commit into
NousResearch:mainfrom
zhao0112:fix/skills-bundle-hash-bytes
Closed

fix(skills): handle bytes in bundle content hash#13531
zhao0112 wants to merge 1 commit into
NousResearch:mainfrom
zhao0112:fix/skills-bundle-hash-bytes

Conversation

@zhao0112

Copy link
Copy Markdown
Contributor

Summary

  • handle bytes entries in bundle_content_hash() without calling .encode()
  • preserve the existing hash behavior for text bundle files
  • add a regression test covering mixed bytes and str bundle content

Fixes #13408

Root Cause

bundle_content_hash() assumed every bundle.files[...] value was a str and always called .encode("utf-8"). SkillBundle.files is already typed as Dict[str, Union[str, bytes]], so any bundle containing raw bytes would crash during hermes skills update with AttributeError.

Validation

  • /Users/zzl/.hermes/hermes-agent-update-20260421/venv/bin/python -m pytest -o addopts= tests/tools/test_skills_hub.py -q
  • /Users/zzl/.hermes/hermes-agent-update-20260421/venv/bin/python -m py_compile tools/skills_hub.py tests/tools/test_skills_hub.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working tool/skills Skills system (list, view, manage) labels Apr 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #3751 (open) — same bytes-in-bundle-hash fix. Maintainers should pick one.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #3751 (open) — same bytes-in-bundle-hash fix. Maintainers should pick one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: bundle_content_hash crashes with bytes values (AttributeError)

3 participants