DSH adopts an “everything is a plugin” architecture, and pluginization is the primary way to extend its capability boundaries. In real-world deployments, interacting with a specific platform is a common requirement for agents. dsh-feishu is a Feishu (Lark) long-connection channel plugin designed for DeepSeek Harness (DSH). It bridges DSH agents to Feishu bots, allowing users to dispatch tasks, receive results, and handle permission approvals through the chat interface.

Maintained by 0x0101010, the core advantage of this plugin is zero npm dependencies. It is implemented directly with the native WebSocket API on Node.js >= 22 and includes a hand-written protobuf frame codec, making it compatible with the official Feishu SDK.

Core Features

  • WebSocket long connection: Uses Feishu’s official WebSocket callback interface (callback/ws/endpoint), so no public IP, port forwarding, or self-hosted callback server is required.
  • Session isolation: Each chat window corresponds to an independent agent context. Idle sessions are automatically reclaimed after a default timeout of 30 minutes.
  • Interactive approval cards: DSH approval requests are rendered as Feishu card buttons (Allow/Deny). Users can act by clicking the button or replying with y/n, and the card updates in place.
  • Mid-turn redirection: Regular messages sent while a task is running are injected at the boundary of the next step in the current turn, without interrupting the task. Use /stop for a hard interruption.
  • Command bridging: All built-in DSH commands in Feishu (such as /permission, /plan, and /compact) can be used directly.
  • Reliable transport: Built-in automatic reconnection (retries after 5 seconds on disconnect), heartbeat keep-alive, event ACKs (to prevent redelivery), and disconnect deduplication based on sequence numbers.

Installation and Enabling

The installation command is as follows:

npx @deepseek-ai/dsh plugin --profile feishu add /path/to/dsh-feishu

The plugin writes configuration into the DSH configuration file, but credentials are not stored in the configuration file and must be provided via environment variables.

Configure the following in the .env file for the corresponding profile (or in the global ~/.dsh/.env):

FEISHU_APP_ID=cli_xxxxxxxx
FEISHU_APP_SECRET=xxxxxxxx
# 可选:指定智能体的工作目录
DSH_FEISHU_CWD=/your/workspace

Verify the configuration and start:

npx @deepseek-ai/dsh --profile feishu --dump-config   # 验证配置是否正确
npx @deepseek-ai/dsh --profile feishu                  # 启动

Typical Usage

Basic Operation Commands

In Feishu chat, you can manage the agent using the following native commands:

  • /new: Destroys the current session, clears the context, and creates a new agent.
  • /mode: Lists all agent presets (minimal/standard/code/cordis) and shows the currently selected one.
  • /mode <preset>: Switches the agent preset for the current session (takes effect immediately only for blank sessions; sessions with history must be reset with /new).
  • /status: Displays the current model, mode, session status, idle reclaim countdown, and other details.
  • /stop: Hard-interrupts the running turn, cancels incomplete tasks, and clears the input queue.
  • /help: Displays built-in help text.

Permissions and Plans

Permission presets are switched via /permission:
* read-only: Files are read-only and no approval is required.
* workspace-write: The workspace is writable, and out-of-bounds operations require approval (default).
* danger-full-access: Full access is granted and no approval is required.

Use /plan to enable planning mode: the agent creates a plan first and waits for approval before execution.

Regular Message Interaction

  • While a task is running: Regular messages do not interrupt the task; they are injected into the next step of the current turn, and the system replies with 📌 to acknowledge receipt.
  • When the task is idle: Messages start a new round, just like a normal conversation.

Configuration and Security

The following configuration items can be adjusted in cordis.patch.yml:

Configuration Item Default Value Description
appId Required Feishu App ID
appSecret Required Feishu App Secret
cwd process.cwd() Working directory for the agent
allowUsers [] Whitelist of user IDs; if empty, no restriction
allowChats [] Whitelist of group chat IDs; if empty, no restriction
sessionTimeoutMs 1800000 Idle session reclaim time (milliseconds)
defaultMode standard Default agent mode

Security Notes:
If allowUsers or allowChats is empty, anyone who can chat with the bot can drive your agent (i.e., execute tasks locally). Be sure to configure proper whitelists before deploying to production. Credentials are read only from environment variables and are not written into the configuration file.

Ecosystem and Maintenance

This plugin follows the MIT license. The DSH ecosystem emphasizes pluginization and community contributions; the plugin directory has no direct affiliation with DeepSeek or High-Flyer.