Conversation
|
1 similar comment
|
Add full QQ Bot integration via the Official QQ Bot API (v2): - WebSocket gateway for inbound events (C2C, group, guild, DM) - REST API for outbound text/markdown/media messages - Voice transcription (Tencent ASR + configurable STT provider) - Attachment processing (images, voice, files) - User authorization (allowlist + allow-all + DM pairing) Integration points: - gateway: Platform.QQ enum, adapter factory, allowlist maps - CLI: setup wizard, gateway config, status display, tools config - tools: send_message cross-platform routing, toolsets - cron: delivery platform support - docs: QQ Bot setup guide
…g, restore missing setup functions - Rename platform from 'qq' to 'qqbot' across all integration points (Platform enum, toolset, config keys, import paths, file rename qq.py → qqbot.py) - Add PLATFORM_HINTS for QQBot in prompt_builder (QQ supports markdown) - Set SUPPORTS_MESSAGE_EDITING = False to skip streaming on QQ (prevents duplicate messages from non-editable partial + final sends) - Add _send_qqbot() standalone send function for cron/send_message tool - Add interactive _setup_qq() wizard in hermes_cli/setup.py - Restore missing _setup_signal/email/sms/dingtalk/feishu/wecom/wecom_callback functions that were lost during the original merge
- Add Platform.QQBOT to _UPDATE_ALLOWED_PLATFORMS (enables /update command) - Add 'qqbot' to webhook cross-platform delivery routing - Add 'qqbot' to hermes dump platform detection - Fix test_name_property casing: 'QQBot' not 'QQBOT' - Add _parse_qq_timestamp() for ISO 8601 + integer ms compatibility (QQ API changed timestamp format — from PR #2411 finding) - Wire timestamp parsing into all 4 message handlers
|
|
Would it make sense to rename the class names to match the platform key "qqbot" — e.g. QQAdapter → QQBotAdapter, check_qq_requirements → check_qqbot_requirements, QQCloseError → QQBotCloseError? |
… shared strip_markdown Improvements from our earlier #8269 salvage work applied to #7616: - Platform token lock: acquire_scoped_lock/release_scoped_lock prevents two profiles from double-connecting the same QQ bot simultaneously - Send retry with exponential backoff (3 attempts, 1s/2s/4s) with permanent vs transient error classification (matches Telegram pattern) - Proper long-message splitting via truncate_message() instead of hard-truncating at MAX_MESSAGE_LENGTH (preserves code blocks, adds 1/N) - REST-based one-shot send in send_message_tool — uses QQ Bot REST API directly with httpx instead of creating a full WebSocket adapter per message (fixes the connect→send race condition) - Use shared strip_markdown() from helpers.py instead of 15 lines of inline regex with import-inside-method (DRY, same as BlueBubbles/SMS) - format_message() now wired into send() pipeline
|
- sidebars.ts: sidebar navigation entry - webhooks.md: deliver field routing table - configuration.md: platform keys list - sessions.md: platform identifiers table - features/cron.md: delivery target table - developer-guide/architecture.md: adapter listing - developer-guide/cron-internals.md: delivery target table - developer-guide/gateway-internals.md: file tree listing - guides/cron-troubleshooting.md: supported platforms list - integrations/index.md: platform links list - reference/toolsets-reference.md: toolset table (qqbot.md, environment-variables.md, and messaging/index.md were already included in the contributor's original PR)
|
Summary
Salvage of PR #7616 by @topcheer and @xing8star — adds QQ Bot as a fully supported messaging platform in the Hermes gateway using the raw Official QQ Bot API v2 (no SDK dependency).
Replaces the earlier #8269 salvage (qq-botpy SDK) with the significantly better #7616 implementation (raw aiohttp + httpx). Cherry-picked contributor commits onto current main, then fixed 3 missing integration points and added ISO 8601 timestamp parsing.
Why #7616 over #8269
Changes from original PR #7616
3 missing integration points filled:
gateway/run.py: Platform.QQBOT added to_UPDATE_ALLOWED_PLATFORMSgateway/platforms/webhook.py: "qqbot" added to cross-platform delivery routinghermes_cli/dump.py: "qqbot" added to platform detectionISO 8601 timestamp fix (from PR #2411 finding):
_parse_qq_timestamp()— handles both ISO 8601 strings and integer millisecondsdatetime.now())Test fix:
What this PR includes
Adapter (~1930 lines):
Integration (20 files):
All 34 checklist points covered — config, run.py, cron, CLI setup/status/dump/platforms, send_message tool, toolsets, prompt hints, webhook routing, docs.
Tests: 65 tests covering init, ACL policies, heartbeat, dispatch routing, session management, JSON parsing, message types, STT config, close codes, message building.
Docs: Full setup guide at
website/docs/user-guide/messaging/qqbot.md+ env vars reference.Test results
Credit
Closes #8269, #7616, #7711, #7550, #7268, #2411