Skip to content

fix(wecom): accept aibot hex keys and strip group mentions#11750

Open
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/wecom-image-key-format
Open

fix(wecom): accept aibot hex keys and strip group mentions#11750
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/wecom-image-key-format

Conversation

@sgaofen

@sgaofen sgaofen commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept 64-character hex aeskey values from the WeCom aibot websocket while preserving the existing base64 callback flow
  • strip a configured plain-text @BotName prefix from group messages before slash-command detection
  • expose bot_display_name via config/env wiring and document it in the CLI config example

Root Cause

WeCom aibot image payloads can deliver aeskey as a 64-character hex string, but _decrypt_file_bytes() only tried base64 decoding. Group chat messages also arrive with a literal @DisplayName prefix and no structured mention metadata, so commands like @Hermes /reset never reached the existing slash-command path.

Testing

  • python3 -m py_compile /Users/stephenyu/Documents/hermes-agent-wt-11447/gateway/platforms/wecom.py /Users/stephenyu/Documents/hermes-agent-wt-11447/gateway/config.py /Users/stephenyu/Documents/hermes-agent-wt-11447/tests/gateway/test_wecom.py
  • uv run --directory /Users/stephenyu/Documents/hermes-agent-wt-11447 --extra dev pytest -o addopts='' /Users/stephenyu/Documents/hermes-agent-wt-11447/tests/gateway/test_wecom.py -q

Platform Tested

  • macOS

Contribution Guide Notes

@sgaofen

sgaofen commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the failing test check appears to be an unrelated upstream failure, not a regression in this WeCom patch. Both this PR and #11752 are red on the same test: tests/hermes_cli/test_opencode_go_in_model_list.py::test_opencode_go_appears_when_api_key_set, with the opencode-go model order coming back as ['kimi-k2.5', 'glm-5.1', 'glm-5', ...] instead of the asserted order. The WeCom-specific targeted regression suite still passes locally (34 passed).

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

Labels

P2 Medium — degraded but workaround exists platform/wecom WeCom / WeChat Work adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(wecom): aibot image decryption fails + group @mention not stripped

2 participants