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-onlydouyin_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:
- Request
http://127.0.0.1:<cdpPort>/json/listto get the page list - Find the Douyin page’s targetId in the list
- Establish a WebSocket connection to
ws://127.0.0.1:<cdpPort>/devtools/page/<targetId>using that targetId
Reading Group Messages¶
- Find the item in the conversation list whose title contains the group name (selector:
[data-e2e="conversation-item"]) - Click that item to open the group conversation
- Read the message content (selector:
[data-e2e="msg-item-content"]), walk up to theMessageBoxContentrow, and split out “sender / body”
Sending Messages¶
- Focus the input field (selector:
[data-e2e="msg-input"] [contenteditable]) - Use
execCommand('insertText')to insert the text - Simulate a real Enter keypress via CDP
- 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¶
- Place this directory somewhere (do not put it inside DSH’s node_modules)
- 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
- Restart DSH
- Copy
config.example.jsontoconfig.jsonand 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.
cdpPortdefaults to 47890, which is the default debug port for thedsh-fish-souldedicated 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-e2ehooks, the plugin will stop working: in that case you’ll need to update the selectors inlib/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.