dsh-qqbot-bridge: Integrating QQ Private Chats into Existing DSH Agent Sessions

Preface

When running multi-Bot teams in DeepSeek Harness (DSH), each role typically maintains an independent long-running session: history, memory files, tool permissions, and workspace are all bound to this session. To reach them via QQ private chat, a common approach is to write another QQ bot using the same system prompt to call the model. However, this loses the context within the real session, and the Web and QQ ends become two disjointed conversations.

Below is an introduction to the community plugin dsh-qqbot-bridge (maintainer WuChangqing1). It delivers QQ official Bot private chat messages into the session where the Bot is already running within DSH and sends replies back to QQ. It does not open a second set of QQ gateways, nor does it duplicate the system prompt.

What is this

dsh-qqbot-bridge is a DSH workflow-class plugin, currently at version 0.1.0 (MIT License, Node >=22.19.0). In one sentence, its positioning is: Bridge QQ official-bot private chats into DeepSeek Harness agent sessions — same session, same memory, same permissions.

The difference from a “typical QQ ⇄ LLM bridge” lies in: reusing the real session via sessionController.resolveAgent(sessionId) and agent.followup(createUserMessage({ source })); the Web UI and QQ share the same session ID; it reuses the websocket already established by the official @tencent-connect/dsh-qqbot—this plugin only consumes Cordis services and does not connect to the socket itself; the whitelist allowOpenIds: [] means deny everyone (fail-closed), and OpenIDs of rejected users are only logged, not automatically allowed; group chat is disabled by default, and group messages are handed back to the official plugin’s original link.

How it works (Overview)

The message path can be summarized as:

QQ Private Chat → @tencent-connect/dsh-qqbot (with local fork patch) → dsh-qqbot-bridge
  → Whitelist / Command Routing / Queue & Deduplication → Read-only state.json to get current session id
  → resolveAgent → followup → Same DSH session (msg.source.kind = 'qqbot-bridge')
  → Session/event collects reply → Sent back to QQ in shards

The official QQ plugin previously did not expose Cordis services, so external plugins could not share connections or insert middleware; starting another gateway with the same AppID would steal the event stream. Therefore, the project requires a minimal local fork of the stock package (patch 0001: insert optional preHandlers before the middleware chain and ctx.provide('qqbot', …)). Hosts that do not use this extension point behave identically to the original.

Core Features

  1. Session-level Bridging: QQ private chat enters the real DSH session of the corresponding Bot, retaining history, memory, tools, and workspace. When the session rolls to a new part, state.json is re-read before each send.
  2. Multi-Bot Routing: Switch the current conversation target via in-QQ commands (see “Typical Usage” below). Routing is persisted to routing.json, distinguished by OpenID.
  3. Secure by Default: Empty whitelist rejects all private chats; v1 only supports private chat, allowGroups: false.
  4. Observable: Console logs and bridge-status.json; the plugin registers the qqbotBridge Cordis service for operations queries; official commands like /bot-ping and /bot-status still go through the original link.
  5. Helper Scripts: Self-check, generate fork, write Web profile, show rejected OpenIDs, etc. (see installation steps).

Installation and Enablement

Prerequisites: DSH Web profile installed, official QQ plugin installed and AppID bound, and Team Bots created in DSH. The installation process follows the repository README; it is not a one-line command like dsh plugin add github:…. You need to execute scripts after cloning or downloading the project directory (Source materials prohibit repeating git clone in this article, please obtain source code from the GitHub Repository).

First, run self-checks in the project root directory (no additional runtime dependencies):

node scripts/run-tests.mjs
node scripts/audit-constraints.mjs
node scripts/verify-host-resolution.mjs

Generate the locally forked QQ plugin package (automatically locates the installed stock package, or use --from <dir>):

node scripts/make-bridged-qqbot.mjs --out ../dsh-bridged-qqbot
(cd ../dsh-bridged-qqbot && pnpm install --prefer-offline)

Point the Web profile to the fork and mount this bridge plugin (recommend checking the dry-run diff first):

node scripts/install-profile.mjs --fork ../dsh-bridged-qqbot --project . --dry-run
node scripts/install-profile.mjs --fork ../dsh-bridged-qqbot --project .

After stopping DSH, install dependencies within the profile and restart:

cd ~/.dsh/profiles/web && pnpm install

After startup, logs should show something similar to:

[qqbot-bridge] apply() entered (plugin v0.1.0)
[qqbot-bridge] allowOpenIds: 0 configured -- FAIL CLOSED, every QQ peer is refused
[qqbot-bridge] provided the "qqbotBridge" service
[qqbot-bridge] STARTED: transport=dsh-qqbot-bridge/qq | snapshot=...

Whitelist configuration: First, send a private chat to the Bot in QQ (it will be rejected), then look up the OpenID and write it into the profile patch:

node scripts/show-openids.mjs

In ~/.dsh/profiles/web/cordis.patch.yml, set allowOpenIds: ["YOUR_OPENID"] for the plugin qqbot-bridge. DSH supports configuration hot-reload, so generally no restart is needed.

Configuration items are all in your profile patch, not in the plugin repository. Field examples explicitly appearing in the source materials:

- id: qqbot-bridge
  config:
    allowOpenIds: []        # Empty array means deny everyone, only add trusted OpenIDs
    defaultBot: Butler       # Default conversation target for private chat users who haven't switched Bots yet
    allowGroups: false      # v1 private chat only
    replyTimeoutMs: 600000  # Reply waiting timeout (milliseconds)

Typical Usage (QQ Client)

Command Function
/Butler /Designer /Programmer /Chat Switch the Bot for the current conversation (persisted by OpenID)
/Team List teams
/Current Show the Bot currently talking to
Other text Sent to the current Bot, replies return to QQ via bridge

Questions initiated on QQ can be continued in the same session on the DSH Web UI; vice versa.

Use Cases and Cautions

Suitable for: Developers who already maintain multi-Agent / multi-session teams within DSH, wish to reach the same set of memories and permissions via mobile QQ private chat, and are willing to perform a minimal fork on the official QQ plugin and modify the Web profile as documented.

Important Notes:

  • The plugin runs with the same permissions as the DSH process; please read the source code and MIT License before installation to confirm the fork and profile changes are acceptable.
  • Default is fail-closed; if no OpenID is configured, all private chats will be rejected. This is expected behavior.
  • Peer dependencies include @deepseek-ai/cordis, @deepseek-ai/schemastery, @deepseek-ai/dsh-agent, @deepseek-ai/dsh-session, etc. (see repository package.json for version ranges).
  • The community directory SkillHub Plugin Page and GitHub are independent information sources and have no official affiliation with DeepSeek / High-Flyer; stars and versions are subject to the repository.

Conclusion

dsh-qqbot-bridge solves the gap between “QQ reachability” and “DSH real sessions”: it does not copy prompts or open double gateways, incorporating private chats into the existing Agent workflow. For details and test instructions, see GitHub: WuChangqing1/dsh-qqbot-bridge, Directory Page: SkillHub - dsh-qqbot-bridge.

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

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

Xiaoye