Introduction¶
DSH provides session, model, and tool calling capabilities. In actual use, an external entry point is often needed: sending messages directly in Feishu (Lark) for the DSH session to process and echo the generation process back to Feishu. dsh-feishu-bridge is the DSH plugin that does this. It bridges Feishu messages to DSH sessions, and after AI processing, replies in real-time using streaming interactive cards without relying on public webhooks.
Plugin Positioning¶
dsh-feishu-bridge is maintained by fengs2021, with version declared as 1.1.0 in package.json and a license of MIT (from package.json). It is not an independent chat service, but a bridging plugin running within the DSH host process: Feishu channels connect to DSH, while DSH’s sessions, models, and tools are still provided by DSH. Below is an introduction to its core capabilities, installation methods, typical usage, and limitations to confirm before deployment.
Core Capabilities¶
- Feishu private chat / direct messages enter DSH sessions, maintaining multi-turn context.
- Responds when
@-ing the bot in group chats; requires configuration ofbotOpenId. - CardKit 2.0 streaming interactive cards for real-time updates: Chain of Thought, body, and tool chain partitioned display,
token-level typewriter effect, and native collapsible panels. - Automatically
agents.resumeafter DSH restart, restoring the same DSH session. - Supports
/help,/reset, and/statusslash commands. - Automatically sends a follow-up text message if a long reply exceeds the limit (8000 characters).
- Automatic backoff reconnection on disconnection, with a range of
2sto30smaximum. - Limits chat users via an
open_idallowlist; an empty allowlist means everyone. - Idempotent deduplication based on
message_idto avoid duplicate processing of event replays. - Registers the
feishuchannel to the DSH global registry, supportingde_channel_send/de_notifyto send text, images, and files to Feishu.
Installation and Enablement¶
Prerequisites for running:
- DeepSeek Harness is running with
dsh web. lark-cliis installed and a bot identity is selected (tenant_access_token).- The Feishu custom application has bot capabilities, and the application permission scope covers the target users/groups.
- The application requires
im:messagepermission; events use Feishu Open Platform long-connection subscription, so no public webhook/callback URL is needed.
Installation steps:
git clone https://github.com/fengs2021/dsh-feishu-bridge.git ~/.dsh/plugins/dsh-feishu-bridge
cd ~/.dsh/plugins/dsh-feishu-bridge && npm install
# register into the web profile:
# dependencies += "dsh-feishu-bridge": "link:/root/.dsh/plugins/dsh-feishu-bridge"
# dsh.profile.bundles += "dsh-feishu-bridge"
cd ~/.dsh/profiles/web && pnpm install
systemctl restart dsh-web
First, clone the plugin to the DSH plugins directory and install dependencies, then register it into the web profile’s dependencies and dsh.profile.bundles, and finally install web profile dependencies and restart dsh-web.
Typical Usage¶
Send messages directly to the bot in Feishu; in group chats, @ the bot to trigger DSH processing.
Slash commands:
/help
/reset
/status
/help displays help, /reset clears context, and /status shows session status.
DSH can also push to Feishu actively:
de_channel_send channels=feishu content=...
Available when sending attachments:
attachments=[{kind:'image'|'file', path|url|base64, fileName?}]
The target defaults to the most recent Feishu session, but can be explicitly specified:
target: 'p2p:oc_xxx'
Configuration and Limitations¶
botOpenIdis used for group chat@detection; it can be obtained via startup auto-detection, logs when@-ing in groups, or the Feishu console.- An empty
allowlistmeans allopen_ids can chat; if non-empty, only the specifiedopen_ids can chat. - If text mode replies exceed
maxReplyChars(default3500), they will be split into segments; if the card preview limit of8000characters is exceeded, a text message will be sent as a follow-up. - Card streaming update default minimum interval is
1200ms, card polling interval is600ms, and the maximum wait time for a single round is600000ms. - Card updates must use
PATCH /open-apis/im/v1/messages/:message_idwith a card JSON string;PUT+msg_typecannot be used. - The streaming listener affects all LLM calls; reference material suggests not reverting to
async.
Applicable Scenarios and Notes¶
Suitable for deployment scenarios where you want to chat with DSH via Feishu, need to send DSH proactive notifications to Feishu, or require card-based process echo.
Notes to consider:
- The plugin runs in the DSH host process and follows the permissions of the current
dshprocess. You should check the source code, dependencies, and license before installing. - The Feishu custom application must have bot capabilities, the permission scope must cover the target users/groups, and the
im:messagepermission must be available. - Group chat response depends on
botOpenIdand the application’s permission scope. - Events are subscribed to via the Feishu Open Platform’s long-connection, so no public webhook/callback URL is needed, but
lark-climust still be able to access the Feishu Open Platform normally. - This plugin version is
1.1.0with an MIT license.
Links¶
- Plugin Directory Page: https://www.skillhub.cn/plugins/fengs2021/dsh-feishu-bridge
- GitHub Repository: https://github.com/fengs2021/dsh-feishu-bridge