Two-way Feishu (Lark) chat bridge for DeepSeek Harness over the official WebSocket long connection: messages route to the bound workspace's latest session and replies return automatically; bot credentials and workspace routing are configurable from the settings page.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-feishu-chat
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Qing45/dsh-feishu-chat
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Feishu (Lark) bot bridge for DeepSeek Harness: send a message to your Feishu bot and your DSH agent answers; the agent can also push messages back to Feishu.
Features
- Connect your Feishu bot by filling in App ID / App Secret — install the plugin, open
设置 → 飞书, paste the two values from Feishu Open Platform → your app → 凭证与基础信息, click 保存并重新连接, and the long connection comes up immediately. No config files to edit by hand. - Switch the bound workspace at any time — the same settings page lists every workspace the profile knows about (name + path + last activity). Click any row to retarget inbound Feishu messages to that workspace; the choice persists and the router reroutes live without restarting the harness.
- Two-way chat — Feishu messages arrive over the official WebSocket long connection (
im.message.receive_v1) and are delegated to a subagent of the bound workspace's latest session; the text reply is sent back to the same chat automatically. - Agent → Feishu tool — the model gets a
feishu_send_messagetool, so any session can push a message to the last chat that contacted DSH (or a givenchat_id). - Robust long connection — protobuf frame decode (
pbbp2), automatic ack, ping keep-alive, fragment merging (sum/seq), and reconnect with backoff, all in-process; stopping or updating the plugin tears everything down cleanly.
Install
# from npm (once published) or from this repo:
dsh plugin --profile web add dsh-feishu-chat
# or directly from GitHub:
dsh plugin --profile web add github:Qing45/dsh-feishu-chat
Then restart dsh web and open 设置 → 飞书:
- Connect the bot — fill in the App ID and App Secret (Feishu Open Platform → your app → 凭证与基础信息), click 保存并重新连接. The status line turns green when the long connection is up.
- Pick the workspace — the workspace list shows every workspace the profile knows about (name + path + last activity). Click any row to bind it; inbound Feishu messages will be routed to that workspace's latest session from now on. Switch any time, no restart needed.
⚠️ This plugin is community third-party code — installing it runs it with your own permissions. Check the source before installing. Credentials stay local in
$DSH_HOME/feishu-bot/config.jsonand are never committed or uploaded.
How it works
| Piece | File | Role |
|---|---|---|
| Host entry | lib/index.js |
Cordis plugin (export const name + export function apply), wires config, router, WS client, tool and HTTP routes |
| Feishu API | lib/feishu.js |
node:https helpers: tenant token, send message, WS endpoint |
| WS client | lib/ws.js |
in-process long connection: protobuf pbbp2.Frame, auto-ack, ping, fragment merge, reconnect |
| Router | lib/router.js |
inbound message → resolve parent agent (initiator → live agent → resume) → subagent → reply |
| Config | lib/config.js |
$DSH_HOME/feishu-bot/config.json persistence |
| Routes | lib/routes.js |
HTTP routes for the settings UI (same-origin writes only) |
| Client | client/client.js |
window.__ModuleLoader__.load bundle registering the 设置 → 飞书 section |
The package is a standard DSH bundle: package.json declares dsh.bundle.patch (layer insertion) and dsh.client (web bundle), and cordis.patch.yml inserts the plugin row into the profile tree.
Development / local install without a GUI restart
The profile's own patch layer ($DSH_HOME/profiles/<profile>/cordis.patch.yml) is hot-reloaded:
pnpm --dir "$DSH_HOME/profiles/web" add /path/to/dsh-feishu-chat
Then append to cordis.patch.yml:
- insert:
- id: feishu-bot
name: 'dsh-feishu-chat'
Refresh the browser — the settings section appears without restarting the harness.
Caveats
- One subagent is spawned per inbound message (no queueing); replies may arrive out of order under a burst.
- The TLS verification is relaxed (
rejectUnauthorized: false) so the long connection works behind corporate MITM proxies / broken certificate stores; review this trade-off for your environment. - The tool name is
feishu_send_message;chat_iddefaults to the most recent chat that contacted DSH.
License
MIT
Links
More in this category
xmanrui/dsh-im★ 3574
Connect IM bots to DeepSeek Harness via QR codes or bot credentials (9 channels: Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp).
shaobeichen/dsh-pocket★ 2955
Remote phone access to the DSH Web UI: scan a QR code for LAN or public (cloudflared tunnel) access with real-time sync, a mobile-adaptive layout, and a settings tab.
OpenPetsHQ/openpets#dsh★ 1400
Bridges DeepSeek Harness lifecycle status, errors, and approval requests to a locally running OpenPets desktop companion.
c1overzz/dsh-bili-scroll★ 1393
Let your DSH agent browse Bilibili on its own, read subtitles, write a daily digest, and @ you when it finds something worth your attention.
inclusionAI/Avernet#deepseek-harness-channel-bcn★ 602
Connects DeepSeek Harness to Avernet's Bot Collaboration Network over WebSocket V2, with automatic onboarding, isolated agent sessions, tool-call events, and multi-bot routing tools.
zaofan-make/dsh-qqbot★ 251
QQ official bot channel (enhanced fork of tencent-connect/dsh-qqbot): full agent chat in groups and DMs, rich media, an auto-tagged sticker library with AI image replies, join approval, mute and broadcast, scheduled wakeups, remote approvals over QQ, interactive cards, multi-account instances, extensions, member profiles, and token-saving value-scored wakeups.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.