Skip to content

feat(gateway): yuanbao (Tencent 元宝) platform adapter#16298

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c91d4ca1
Apr 27, 2026
Merged

feat(gateway): yuanbao (Tencent 元宝) platform adapter#16298
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c91d4ca1

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #13276 — first-party Yuanbao (腾讯元宝) gateway platform contributed by @loongfay (Tencent).

Summary

Adds full Yuanbao (Tencent's 100M+ MAU IM platform) support: WebSocket transport, AUTH_BIND/HMAC-SHA256 signing, 17-middleware inbound pipeline, fence-aware outbound, COS media upload, TIMFaceElem stickers, and a check_fn-gated hermes-yuanbao toolset.

Changes

  • New yuanbao-owned files (~8.5k LOC): gateway/platforms/yuanbao{.py,_proto.py,_media.py,_sticker.py}, tools/yuanbao_tools.py, skills/yuanbao/SKILL.md, 4 test files (2.4k LOC)
  • Core-file touches (surgical, ~150 LOC total, matches qqbot's pattern):
    • gateway/run.py (+14): adapter factory branch + YUANBAO_ALLOWED_USERS/YUANBAO_ALLOW_ALL_USERS allowlist envvars
    • gateway/config.py (+46): Platform.YUANBAO enum + env-var overrides block
    • gateway/platforms/__init__.py (+2): YuanbaoAdapter export
    • gateway/session.py (+8): platform hint for send_message targets
    • agent/prompt_builder.py (+23): PLATFORM_HINTS["yuanbao"] entry
    • tools/send_message_tool.py (+46): yuanbao target regex + _send_yuanbao() helper + MEDIA support
    • toolsets.py (+27): yuanbao + hermes-yuanbao toolset registration
    • cron/scheduler.py (+3): platform enum map for cron delivery
    • hermes_cli/{gateway,setup,platforms,status,tools_config}.py: setup wizard + status row
    • scripts/release.py: 11 AUTHOR_MAP entries for Tencent contributors
  • Docs: website/docs/user-guide/messaging/yuanbao.md + index update

Design

  • Tools check_fn-gated on HERMES_SESSION_PLATFORM=yuanbao or active adapter — zero tool-schema bloat for non-yuanbao users
  • Standard HMAC-SHA256 via stdlib (no rolled crypto), per-app_key refresh locks
  • Middleware pipeline and MediaSendHandler ABC follow the same shape as feishu.py
  • All core-file edits mirror existing platform patterns (qqbot is the closest analog)

Validation

  • All 215 yuanbao-specific tests pass (test_yuanbao_proto.py, test_yuanbao_pipeline.py, test_yuanbao_integration.py, test_yuanbao_markdown.py)
  • tests/tools/test_registry.py discovery test (31 tests) passes with tools.yuanbao_tools added
  • We cannot E2E against a live Yuanbao bot — requires Tencent account + bot registration. @loongfay tested on macOS against the real platform per the PR description.

Closes #13276. Authorship preserved: commit by loongzhao@tencent.com via rebase-merge.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 CRITICAL Supply Chain Risk Detected

This PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging.

🚨 CRITICAL: Install-hook file added or modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets labels Apr 27, 2026
@teknium1 teknium1 merged commit ab68796 into main Apr 27, 2026
11 of 13 checks passed
@teknium1 teknium1 deleted the hermes/hermes-c91d4ca1 branch April 27, 2026 01:50
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Co-authored-by: loongzhao <loongzhao@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants