dsh-qq-bridge: A Bridge Plugin Connecting QQ (OneBot v11) to DeepSeek Harness

Preface

Running Agents in DSH usually means entering via Web UI or CLI; to hook in everyday chat channels you often have to write your own forwarding layer, maintain session IDs, and deal with group @ mentions, message batching, and reply pacing. The OneBot v11 ecosystem (NapCat, Lagrange, go-cqhttp, etc.) can already package QQ events into a unified protocol, but aligning them with the Harness’s Sessions, tool whitelists, and long-term memory is still up to you.

Below is the community plugin flyinstar/dsh-qq-bridge (npm package @qqbot/dsh-plugin-qq, current version 0.2.0, MIT licensed). It connects QQ to DSH via OneBot’s forward WebSocket: inbound messages drive dedicated Agent sessions, and outbound messages can be proactively sent back to QQ via tools like qq_send_*. Maintainer: flyinstar; the GitHub repo has about 1 star. The author notes this is a personal-use project, docs are written for single-machine usage, it is not guaranteed to work out of the box, and you need to adjust configuration per the documentation.

What This Is

In one sentence: a QQ ↔ DSH bidirectional bridge plugin — each QQ private chat or group maps to a persistent DSH Session (the id is deterministically derived from the session key via SHA-256 and resumes after restart); the Agent’s last text-bearing assistant reply in that turn is sent back to QQ, while intermediate tool calls never appear directly on the QQ side.

Data flow (excerpted from the official README):

QQ 客户端 ──▶ NapCat ──(OneBot v11 WebSocket)──▶ 本插件
                                                    │
                                    每个会话映射一个 DSH Session
                                                    │
                                    Agent 产出最终回复 ──▶ 发回 QQ

Configuration is concentrated in cordis.patch.yml’s config: (schema in config.js) and can also be modified via Web UI Settings → QQ Bridge. Note that DSH’s patch is a whole-block replacement rather than a deep merge — don’t hand-write a config: with only a few fields to override the entire config section.

Core Features

The following capabilities come from the repo README and documentation index, grouped by module.

Bidirectional Chat & Sessions

  • Inbound: QQ private messages, or group messages that @ the bot (default groupTrigger: mention), enter the corresponding Session for processing, and the result is automatically sent back to QQ.
  • Outbound: Any DSH Agent (including the Web UI main session) can call qq_send_* to proactively send text, images, etc.
  • Group-chat-style expressions: message batching (default batchWindowMs 2s), replies split into short bubbles, typing pacing, quotes / @; the model’s own chime-ins don’t attach a mention target.
  • Side behaviors: identical-text echoing, proactively chiming in during lulls, joining the chat without @ once things warm up (activeFollow), adding a follow-up line in private chats, etc. — each with its own switch and caps; private chats don’t proactively disturb by default.

Media, Memory & Reminders

  • Images & stickers: supports read_image for viewing images, sending stickers, saving user stickers into a collection directory; links / videos / voice messages etc. have separate handling notes (see docs/media.md).
  • Scheduled reminders: sent directly by the plugin when the time comes, surviving restarts; default permissions are conservative (mainly reminding yourself; @-ing others / everyone is off by default).
  • Long-term memory (memory on by default): transcripts persisted to disk, daily summaries written into MEMORY.md, etc., injected via retrieval; person table, cognitive knowledge base, sticker directory, etc. are covered in docs/memory.md.
  • Message recall: clearing the quote acts as a safety layer; whether to tease is decided by recallMode (default ignore) and other settings.

Persona & Tools

  • PERSONA.md and STYLE.md are hot-loaded, defining “who” the agent is and “how” it speaks.
  • QQ sessions mount a minimal qq preset by default, with an allowTools whitelist of about 18 tools — no write / edit / bash by default. Ops-side provides doctor / status / logs / restart (see docs/ops.md).

Security Defaults (Read First)

  • QQ messages are treated as untrusted input; group messages are triggered only by @ by default. Settings like proactive and activeFollow relax the “only reply when addressed” rule — if you’re not comfortable, turn them off in config or the Web UI.
  • QQ-side capabilities that can write to disk directly are mainly limited to the sticker directory and validated reminder tasks; see the README “Security” section and docs/security.md for details.

Installation & Activation

Prerequisites: DSH installed, with model credentials configured on the Web UI Models page. The OneBot implementation must enable a forward WebSocket server (not websocketClients), with the address matching the plugin’s endpoint (default ws://127.0.0.1:3001).

Obtaining the Plugin Code

The official README’s “start in 30 seconds” approach is as follows (this article omits git clone):

  1. Download the release package from the GitHub Releases; on Windows, after extracting, run scripts\napcat-setup.cmd, which will configure NapCat and the plugin.
  2. For Linux / container scenarios, see the repo’s docs/install.md; for same-machine Windows desktop deployment, see docs/windows.md.

Runtime: package.json requires Node >= 22.

Connecting OneBot and Starting the Harness

  1. Have NapCat (or another OneBot v11 implementation) listen on WebSocket with the port matching endpoint, and complete QQ QR-code login.
  2. If accessToken is configured, set the same value in the plugin’s accessToken (or the environment variable QQBOT_ACCESS_TOKEN).
  3. Start the resident process (README example):
dsh --profile qqbot --port 3081 --no-open

You can also host it via the repo’s deploy/qqbot.service or similar. After modifying plugin source code you must restart the Harness (the Loader caches modules by URL).

Verification

Send the bot a private message; if you receive a reply inside QQ, the OneBot → plugin → DSH Session → reply chain is working.

Typical Usage & Configuration

Commonly Changed Config Fields

Field Default Description
endpoint ws://127.0.0.1:3001 OneBot v11 WebSocket (QQBOT_ENDPOINT)
accessToken '' OneBot access_token
cwd Process current directory Agent working directory; where media / memory / persona files land
groupTrigger mention Group trigger: mention / prefix / all
allowUsers / allowGroups [] Whitelist; empty means no restriction
agentPreset qq Preset for QQ sessions
proactive true Proactively speak up in groups (not in private chats)
memory true Long-term memory
reminder true Scheduled reminders

See docs/configuration.md for the full field list.

Persona & Self-check

To pin down a character: copy the template per docs/persona-workshop.md and modify PERSONA.md / STYLE.md, or use the multiple-choice flow in the docs to generate them, then run the self-check script to see what the model can see.

Dev Self-testing

The maintainer’s local verification command:

node --test test/

Use Cases & Caveats

Who it’s for: Those already running Agents with DSH who want QQ as a bidirectional channel via OneBot v11; willing to maintain NapCat (or similar) and cordis.patch.yml / env vars yourself, and accept the author’s positioning of “not a general-purpose plugin; requires changes per the docs.”

Runtime permissions: The plugin executes with the current dsh process; the tool whitelist and cwd determine which paths it can read/write. Before installing, read the repo source and the MIT license, and verify that allowTools, reminders, and sticker disk-writes meet your security requirements.

Ecosystem note: The DSH community plugin directory (e.g., flyinstar/dsh-qq-bridge on SkillHub) is community-maintained and has no official affiliation with DeepSeek / 幻方 (Huanfang); versions and behavior are governed by the GitHub repo and CHANGELOG.

Conclusion

dsh-qq-bridge aligns OneBot v11 with DSH Sessions: inbound chat, outbound qq_send_*, group-chat pacing, and memory/reminders all handled in one config. Deployment focuses on the release package, the qqbot profile, and NapCat’s forward WebSocket; details follow the official docs map (install, config, security, memory, ops).

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

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

Xiaoye