DeepSeek Harness Douyin Group Read/Reply Plugin

Preface

DeepSeek Harness (DSH) adopts a “everything is a plugin” architecture, allowing developers to inject capabilities into existing processes via a patch mechanism. If you’re using the Douyin channel in dsh-fish-soul, the current read logic only handles “private message conversations.” Group chat conversations (with IDs in the format 0:2:…) are treated as “read failures,” which prevents the agent from perceiving group messages. This directly causes the “she gets @’d in a group but never receives the message” problem. Below I introduce a plugin that takes over an already-open Douyin browser (via CDP) and uses DOM manipulation to bypass the read layer, enabling the agent to both read and reply in group chats.

What This Is

This is a plugin that adds two tools to DeepSeek Harness: douyin_group_read and douyin_group_say.

  • douyin_group_read: Reads the most recent messages in a group (with sender attribution), read-only
  • douyin_group_say: Sends a message to the group (a real send, with a read-back verification afterward)

Maintained by xiaoniana2026. It does not use any official API. Instead, it acts as a second CDP client that attaches to your already-open Douyin browser, reading and writing group chat messages through the page DOM. Login state, risk control, and signing are all handled by the browser itself—no extra work required from the developer.

Core Features

Taking Over the Browser

The plugin locates the Douyin page via CDP and establishes a WebSocket connection. The steps are as follows:

  1. Request http://127.0.0.1:<cdpPort>/json/list to get the page list
  2. Find the Douyin page’s targetId in the list
  3. Establish a WebSocket connection to ws://127.0.0.1:<cdpPort>/devtools/page/<targetId> using that targetId

Reading Group Messages

  1. Find the item in the conversation list whose title contains the group name (selector: [data-e2e="conversation-item"])
  2. Click that item to open the group conversation
  3. Read the message content (selector: [data-e2e="msg-item-content"]), walk up to the MessageBoxContent row, and split out “sender / body”

Sending Messages

  1. Focus the input field (selector: [data-e2e="msg-input"] [contenteditable])
  2. Use execCommand('insertText') to insert the text
  3. Simulate a real Enter keypress via CDP
  4. Read back to verify the message was sent successfully

No polling, no auto-wake: the agent’s conversation is managed by other plugins, and forcibly inserting messages would break conversation and memory consistency. The agent invokes the tool herself only when she needs to.

Installation and Setup

  1. Place this directory somewhere (do not put it inside DSH’s node_modules)
  2. Create a directory symlink under the corresponding profile (Windows example):
   mklink /J %USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-douyin-group D:\path\to\dsh-douyin-group

(Use ln -s on macOS/Linux)
3. Append the following to the end of cordis.patch.yml in that profile:

   - insert:
       - id: douyin-group
         name: dsh-douyin-group
  1. Restart DSH
  2. Copy config.example.json to config.json and fill in your group name

Configuration

config.json (changes take effect after restarting DSH):

{ "cdpPort": 47890, "groupName": "你的抖音群名", "maxMessages": 20 }

You can also override via environment variables: DOUYIN_CDP_PORT, DOUYIN_GROUP_NAME.

  • cdpPort defaults to 47890, which is the default debug port for the dsh-fish-soul dedicated browser. If you launch the browser yourself, simply change it to whatever port you specified with --remote-debugging-port.

Known Limitations

  • Only groups whose title in the conversation list contains the configured group name are recognized; if you rename the group, you must update the configuration accordingly
  • Pure image/sticker messages have no text body and cannot be read (they will be skipped)
  • The message list uses virtual scrolling: only the currently rendered items exist in the DOM, 共 N 条 changes as you scroll, and older messages may not be readable
  • The sender name for your own messages is sometimes not parsed (the page only renders the name on other people’s speech bubbles)
  • If Douyin changes its UI and replaces the data-e2e hooks, the plugin will stop working: in that case you’ll need to update the selectors in lib/group.mjs
  • If the browser is not running, the tool will immediately report “cannot connect to debug port” rather than failing silently

Use Cases and Notes

Suitable for developers who need to pull context from group chats and reply within them. The plugin runs with the permissions of the current DSH process; review the source code and license before installing.

Conclusion

This plugin provides a path around the private-message read layer, letting the agent read and reply in Douyin groups. For more details, see the plugin’s directory page and the GitHub repository.

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

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

Xiaoye