dsh-plugin-qq-bot: Integrating the QQ Official Bot with DeepSeek Harness

Preface

DeepSeek Harness (DSH) sessions, presets, and workspaces run within local processes. If you want to casually ask a question on your phone or mention the bot in a group chat to continue the same context, you typically need to set up an additional IM bridge layer: maintaining WebSockets, message formats, and “QQ User ↔ Session” mappings yourself, which involves significant cost and integration effort.

dsh-plugin-qq-bot (Maintainer: 23bear, Category: Client) utilizes the official bot channel of the QQ Open Platform: messages sent in QQ groups or private chats are processed by DSH using a fixed Session, and the replies return to QQ. One QQ user or one group corresponds to one DSH Session (e.g., session-qq-c2c-<openid>, session-qq-group-<group_openid>). Multi-turn context is handled by DSH’s own session persistence; the plugin does not create additional mapping tables. These sessions can also be viewed and archived directly in the GUI.

Community Directory Page: skillhub.cn/plugins/23bear/dsh-plugin-qq-bot (Currently marked as version v0.1.0, installable client-side plugin). Source Code & Documentation: github.com/23bear/dsh-plugin-qq-bot. License: MIT; Runtime Environment Requirement: Node >=22.15.0.

What is this

The plugin connects the official bot from the q.qq.com Open Platform as an input channel for DSH: Receive QQ message → Wake up or continue the corresponding Session → Send the model output back to QQ. Original description: QQ Official Bot Channel Plugin for DeepSeek Harness — talk to your DSH sessions from QQ groups and private chats.

Core Features

  • Group & Private Chat: Mentioning the bot in a group or sending a private message can both trigger DSH processing (requires enabling the corresponding scenarios on the QQ Open Platform).
  • One-to-One Session Correspondence: Generates stable Session IDs based on openid / group_openid; multi-turn conversations do not rely on plugin-side mapping tables.
  • Hot Credential Updates: Recommended path is ~/.dsh/qq-bot.json; after supplementing or modifying it, the gateway connection is established automatically within seconds. Generally, no DSH restart is needed (except when changing config: in cordis.patch.yml, which still requires a process restart).
  • Observable Status: ~/.dsh/qq-bot-state.json records states such as ready / missing-credentials and events logs.
  • Message & Concurrency Strategy: Messages within the same session are serial; different sessions run in parallel. Overly long replies are chunked according to replyChunkChars. Timeout and “processing” prompts are configurable.
  • Local Health Check: /ping and /help do not consume DSH turns and are used to confirm the link and session ID.

Preparation on the QQ Side

Complete the following steps on the Open Platform side in the order specified in the README before configuring DSH.

  1. Open https://q.qq.com, log in to “QQ Open Platform” with your QQ account, and create a bot application (individual subjects are acceptable).
  2. Obtain the AppID and AppSecret (Client Secret) in “Development Settings”.
  3. Enable Private Chat and/or Group Chat in “Feature Settings”. For Group Chat, add a test group in “Sandbox Configuration” (If the new version of Group/Private Chat bots does not have a sandbox domain, the administrator account acts as the test account, and the real environment can be used directly).
  4. Add the bot to the group in group chat scenarios; it is recommended to use a throwaway account or a test group during the testing phase.

Official API Documentation: bot.q.qq.com/wiki/develop/api-v2/. The interface root address is unified as https://api.bot.qq.com starting from 2026-08-10 (the default value for the plugin config apiBase).

Installation and Activation

Neither the fetched materials nor the directory page provide a fixed dsh plugin add … installation command. Please do not construct one yourself based on the repository name. After installing the plugin as a client-side entry to the current DSH environment, provide credentials and (optionally) modify configurations as follows.

Credentials: Three Methods (Priority: Plugin Config → Environment Variables → Credentials File)

The credentials file is recommended to avoid writing secrets into profile patches:

// ~/.dsh/qq-bot.json
{
  "appId": "Your AppID",
  "clientSecret": "Your AppSecret"
}

Or set environment variables DSH_QQ_APP_ID, DSH_QQ_CLIENT_SECRET.

You can also write in the profile’s cordis.patch.yml:

- id: qq-bot
  name: dsh-plugin-qq-bot
  config:
    appId: "..."
    clientSecret: "..."

The credentials file is polled (interval controlled by credentialsPollMs, default 5000 ms); DSH only needs to be restarted if other configuration items under config: are modified.

Common Configurations

Config Default Description
enabled true If false, only writes the status file without connecting to the gateway
appId / clientSecret "" If empty, falls back to environment variables or credentials file
apiBase https://api.bot.qq.com Official interface root address
intents 33554432 1<<25, covers Group @ and Private Chat
agentPreset standard Agent preset used for these sessions
workspace ~/.dsh/qq-bot-workspace Session working directory; modify path if you need to operate on a specific project
allowOpenIds [] If not empty, only responds to listed openid / group_openid
replyChunkChars 1500 Max characters per message; splits if exceeded
maxWaitMs 900000 Max wait time for a single turn; sends existing content first upon timeout
ackAfterMs 12000 Send a prompt if no answer for too long; 0 disables
ackText 收到,正在处理… Prompt text
credentialsFile ~/.dsh/qq-bot.json Credentials file path
credentialsPollMs 5000 Credentials file polling interval (ms)

Typical Usage: Confirming it works and Chatting in QQ

1. Check the Status File

The plugin writes running status to ~/.dsh/qq-bot-state.json, for example:

{
  "status": "ready",
  "lastMessageAt": 1760000000000,
  "lastSessionId": "session-qq-c2c-XXXXXXXX",
  "lastSummary": "[Completed normally, 12.3s]",
  "events": [ { "at": 1760000000000, "message": "info: access_token obtained, valid for 7200s" } ]
}
  • missing-credentials: Credentials not read; auto-retries after the file is supplemented.
  • closed / reconnecting loops: Check events. Common prompts for credential errors include “AppID / AppSecret” or “Bot does not exist”; 4013/4014 are mostly related to intents permissions (Group + Private Chat requires 33554432). The README notes: Requesting a token with an invalid AppID against api.bot.qq.com may still return HTTP 200; you need to check the code in the body (e.g., 10004 Bot does not exist).

2. Send a Message in QQ

Send content via Group @ or Private Chat and wait for DSH processing. A status line is appended at the end of the reply (e.g., [Completed normally, 12.3s]). You can send /ping or /help first for link self-check.

Behavior Summary (from README):

  • Passive Reply Priority: Within 5 minutes for groups and 60 minutes for private chats, msg_id can be used for passive replies (there is a limit on the number of times); beyond this, it switches to normal messages.
  • If a single turn exceeds maxWaitMs, existing text is sent first and marked as timeout.

Use Cases and Notes

Who it is for: Developers already using DSH who wish to use QQ official bots (rather than third-party protocols) as group/private chat entry points; scenarios requiring a fixed QQ identity bound to an archivable Session.

Permissions & Security: The plugin runs with the current DSH process and possesses the local resources and network capabilities accessible to that process. Please read the repository source code and the MIT License before installation, and assess how the AppSecret is stored yourself (credential file permissions, whether written into a patch, etc.). allowOpenIds can be used to narrow down the groups or users that can respond during integration testing.

After modifying plugin code: The README emphasizes ESM module caching—remounting or dsh plugin add does not equal loading new code; the DSH process needs to be restarted. You can use codeVersion in the status file or node tools/check.mjs to verify the current process version (this is a development integration note).

Ecosystem Note: The DSH Community Plugin Directory (SkillHub) is an independent site with no official affiliation with DeepSeek / High-Flyer. Installation and commands are subject to the DSH and directory page instructions in your environment.

Conclusion

dsh-plugin-qq-bot integrates the QQ Open Platform official bot into a client channel for DSH: Once credentials and configurations are set up according to the documentation, you can interface with local Sessions and presets directly in groups or private chats. Directory: https://www.skillhub.cn/plugins/23bear/dsh-plugin-qq-bot; Repository: https://github.com/23bear/dsh-plugin-qq-bot.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye