fix(skills): handle bytes content in bundle_content_hash - #2740
Closed
Mibayy wants to merge 3 commits into
Closed
Conversation
added 3 commits
March 23, 2026 20:30
Display a permissions label so users always know whether the agent is running in FULL ACCESS (--yolo) or RESTRICTED ACCESS mode. Changes: - hermes_cli/banner.py: show 'FULL ACCESS' (red) or 'RESTRICTED ACCESS' (green) line in the welcome banner below the model name - cli.py: append '⚠ FULL ACCESS' fragment to the bottom status bar when HERMES_YOLO_MODE is set (both the fragment renderer and the plain-text fallback) - cli.py: add 'status-bar-yolo' style (#FF4444 bold) for the status bar fragment Default behavior (no --yolo) is unchanged — RESTRICTED ACCESS is shown in green as a positive confirmation. The label is visible on first launch and persists in the status bar throughout the session. Closes NousResearch#2663
Implements full Feishu/Lark integration following the platform checklist: - gateway/platforms/feishu.py: WebSocket (Long Connection) adapter using lark-oapi SDK. App Access Token auth with auto-refresh. Text and rich-text (post) message parsing. Deduplication, reconnect backoff, standalone _send_feishu_message() for cron/tool use. - gateway/config.py: Platform.FEISHU enum, _apply_env_overrides() block (FEISHU_APP_ID + FEISHU_APP_SECRET + FEISHU_HOME_CHANNEL), and get_connected_platforms() check for extra.app_id. Supports both open.feishu.cn (mainland) and open.larksuite.com (international) via FEISHU_USE_LARK_DOMAIN env var. - gateway/run.py: _create_adapter() factory, FEISHU_ALLOWED_USERS and FEISHU_ALLOW_ALL_USERS in both authorization allowlist maps, startup warning, and two platform_toolsets maps (hermes-feishu). - gateway/channel_directory.py: session-based discovery for feishu/dingtalk. - agent/prompt_builder.py: PLATFORM_HINTS for both feishu and dingtalk. - toolsets.py: hermes-dingtalk and hermes-feishu toolsets, both included in hermes-gateway composite. - cron/scheduler.py + tools/send_message_tool.py: feishu in platform_map and _send_feishu() standalone async function for direct delivery. - tools/cronjob_tools.py: feishu added to deliver parameter description. - hermes_cli/status.py: DingTalk + Feishu in platform status display. - hermes_cli/gateway.py: Feishu setup wizard entry with 6-step instructions. - tests/gateway/test_feishu.py: 26 tests covering requirements, adapter init, platform enum, config loading, auth maps, send routing, text extraction, deduplication, and mocked send/error paths. Closes NousResearch#2737
SkillBundle.files is typed Dict[str, Union[str, bytes]] but
bundle_content_hash() was calling .encode('utf-8') unconditionally,
crashing when a binary file (image, compiled asset) is included in a
skill bundle.
Fix: check isinstance(content, bytes) before encoding.
Closes NousResearch#2739
1 task
This was referenced Apr 21, 2026
Collaborator
Collaborator
|
Likely duplicate of #3751. |
Contributor
|
Thanks @Mibayy — same fix already landed on main via #9925 (commit 3072e5543, authored by @dodofun) back in April. Teknium followed up with additional bytes-vs-str equivalence tests in 91ea3ae4b. Current |
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.
Fixes #2739
Root cause
SkillBundle.filesis typedDict[str, Union[str, bytes]]— binary files (images, compiled assets, etc.) are stored asbytes.bundle_content_hash()was calling.encode('utf-8')unconditionally, which raisesAttributeError: 'bytes' object has no attribute 'encode'when any such file is present in the bundle being checked for updates.Fix
One-line guard:
No behaviour change for text-only bundles.