Skip to content

feat(gateway): add native QQ bot support#1000

Closed
AXONAI9000 wants to merge 2 commits intoNousResearch:mainfrom
AXONAI9000:feat/qq-gateway-pr
Closed

feat(gateway): add native QQ bot support#1000
AXONAI9000 wants to merge 2 commits intoNousResearch:mainfrom
AXONAI9000:feat/qq-gateway-pr

Conversation

@AXONAI9000
Copy link

@AXONAI9000 AXONAI9000 commented Mar 12, 2026

What does this PR do?

Adds native QQ bot gateway support so Hermes can connect to QQ using the official qq-botpy SDK, receive C2C/group messages, and send replies back through the QQ bot API.

Related Issue

N/A

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)
  • ✅ Tests (adding or improving test coverage)
  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • 🔒 Security fix
  • 📝 Documentation update
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • add a native QQ gateway adapter in gateway/platforms/qq.py using qq-botpy
  • wire QQ into gateway config/env loading, adapter creation, authorization maps, channel directory, toolsets, prompt hints, and CLI gateway setup
  • add QQ routing to send_message and cron delivery, including standalone REST sending support
  • add QQ-specific gateway tests and update toolset consistency coverage

How to Test

  1. Install messaging extras including qq-botpy.
  2. Set QQ_BOT_APP_ID and QQ_BOT_SECRET in ~/.hermes/.env.
  3. Start the gateway with python -m hermes_cli.main gateway run.
  4. Send a QQ message to the bot and verify Hermes replies.
  5. Run: python -m pytest -o addopts="" tests/gateway/test_qq.py tests/test_toolsets.py tests/gateway/test_config.py tests/tools/test_send_message_tool.py tests/gateway/test_delivery.py tests/gateway/test_signal.py -q

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.3.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • Verified live against a real QQ bot app: token exchange, GET /users/@me, gateway connect, inbound QQ message receipt, and outbound reply delivery.

Copilot AI review requested due to automatic review settings March 12, 2026 01:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class QQ bot integration to the Hermes gateway, enabling QQ connectivity via qq-botpy, QQ message routing, and configuration/CLI support, with accompanying tests to ensure the integration is wired throughout the gateway stack.

Changes:

  • Introduces a native QQ gateway adapter (QQAdapter) and wires QQ into adapter creation, authorization, channel directory, cron delivery, and prompt hints.
  • Extends send_message tool routing to support qq:group:... / qq:user:... targets, including a REST-based standalone sender.
  • Adds QQ-specific tests and updates toolset consistency checks; updates dependency extras to include qq-botpy.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
toolsets.py Registers hermes-qq toolset and includes it in hermes-gateway.
tools/send_message_tool.py Adds QQ target format + routing + REST sender implementation.
tests/test_toolsets.py Ensures hermes-qq shares the same core tool list as other platforms.
tests/gateway/test_qq.py Adds coverage for QQ env/config loading, adapter behavior, and integration wiring checks.
requirements.txt Adds qq-botpy to messaging integration dependencies.
pyproject.toml Adds qq extra and includes it in messaging and all extras.
hermes_cli/gateway.py Adds QQ to interactive gateway setup and status checks.
hermes_cli/config.py Adds QQ-related env var metadata for config prompting.
gateway/run.py Adds QQ adapter factory branch, auth env maps, and toolset/platform mappings.
gateway/platforms/qq.py Implements the native QQ adapter using qq-botpy (gateway receive + send).
gateway/config.py Adds Platform.QQ and env loading for QQ credentials/home channel.
gateway/channel_directory.py Includes QQ in session-derived directory building.
cron/scheduler.py Adds QQ to cron delivery platform map.
agent/prompt_builder.py Adds QQ-specific prompt hint for response formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AXONAI9000 AXONAI9000 closed this by deleting the head repository Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants