Preface

If you are already running the DeepSeek Harness (DSH) agent locally and want to ask questions, track long-running tasks, or follow up directly from Lark instead of just operating within the Web UI, here is an introduction to a DSH plugin: @kriskwok/dsh-feishu-gateway.

It routes Lark messages to the DSH agent and supports persistent sessions, Markdown replies, streaming progress cards, native Typing reactions, approval/question click cards, and an optional proactive push API.

What is it

kriskwok/dsh-feishu-gateway is a Lark gateway plugin native to DeepSeek Harness.

It connects via Lark long connections and does not require a public web webhook URL. Private chat messages or bot @mentions in groups can enter a DSH session, and the DSH agent’s replies will be sent back to Lark in Markdown rich text form.

The repository address is:

https://github.com/kriskwok/dsh-feishu-gateway

Core Capabilities

This plugin primarily provides the following capabilities:

  1. Chat with the DSH agent via Lark, supporting both private chats and bot @mentions in groups.
  2. Connect via Lark long connections, eliminating the need for a public webhook URL.
  3. Persistent sessions: Lark conversations or group topics/threads map to DSH sessions, and this mapping is preserved after restarts.
  4. Supports /new to start a new session, as well as phrases like “start new session,” “new conversation,” “restart,” or “change topic.”
  5. Markdown rich text replies using post messages and md tags, capable of rendering bold text, inline code, lists, links, etc.
  6. Displays native Typing reactions during processing; switches to CrossMark on failure.
  7. Streaming progress cards for long tasks, supporting stream and final modes.
  8. Approval and ask_user_question click-to-answer cards, where users can click buttons to complete allow/deny or select options.
  9. An optional management HTTP API /api/push for proactively pushing text, Markdown, or cards.
  10. Web-only dsh-ui interactive fences degrade to a single line of readable hints on the Lark side instead of outputting raw JSON.

Prerequisites

Before using this plugin, you need to prepare:

  1. DeepSeek Harness installed and built, meaning the dsh CLI is available.
  2. DEEPSEEK_API_KEY configured.
  3. A Lark open platform custom app with the bot capability enabled.
  4. Lark permissions:
im:message
im:message:send_as_bot

Optional permissions:

im:message:send_as_bot:readonly

This permission is used to read content. After configuration, a version must be published.

  1. Select “Long connection” in Events & callbacks and subscribe to:
im.message.receive_v1

Card button click events are also delivered via long connection:

card.action.trigger
  1. Node version requirements from package.json:
^22.19.0 || >=24.0.0

Installation and Enablement

Documentation states that this plugin is not installed with a single dsh plugin add command, but rather through manual installation based on npm/pnpm profiles.

The recommended approach is to mount the gateway to the web profile. This way, when the DSH Web UI starts, the Lark gateway also starts, and they share the same DSH agent.

1. Modify the web profile’s package.json

Edit:

~/.dsh/profiles/web/package.json

Add the @kriskwok/dsh-feishu-gateway dependency and add it to the DSH bundle list.

The example structure is as follows:

{
  "name": "dsh-profile-web",
  "private": true,
  "dependencies": {
    "@kriskwok/dsh-feishu-gateway": "^0.2.0"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "@kriskwok/dsh-feishu-gateway"
      ]
    }
  }
}

This step allows the web profile to know that it needs to load the Lark gateway bundle.

2. Install dependencies

Enter the web profile directory and install dependencies:

cd ~/.dsh/profiles/web && pnpm install

3. Fill in Lark application configuration

Edit:

~/.dsh/profiles/web/cordis.patch.yml

Enter the Lark application credentials. The example configuration is as follows:

- id: feishu-gateway
  config:
    feishu:
      appId: cli_xxxxxxxxxxxxxxxx
      appSecret: xxxxxxxxxxxxxxxxxxxxxxxx
    http:
      port: 3100
      token: your-token

Here, feishu.appId and feishu.appSecret are required fields. The http section is used for the optional management API.

4. Start the web profile

Start or restart:

dsh --profile web

You can also run the repository script, which mounts to the web profile by default:

./scripts/create-profile.sh

If you need to create a standalone Lark profile, you can use:

./scripts/create-profile.sh --standalone

Typical Usage

Integration via private or group chats

Send messages directly to the bot in a private Lark chat, or @bot in a group. The messages will be routed to the DSH agent.

Starting a new session

Send:

/new

You can also send:

start new session
new conversation
restart
change topic

These phrases will all start a new DSH session.

Group topic isolation

In a Lark group, each topic/thread corresponds to a separate DSH session. Messages within that topic remain in the same session until /new is sent.

Control reply strategy in groups

You can set:

feishu.replyMode: at

or:

feishu.replyMode: all

at is the default value, indicating replies only occur when mentioned. all indicates replying to every message in the group.

Control long task progress display

You can set:

reporting.mode: stream

or:

reporting.mode: final

stream is the default value, indicating the use of streaming progress cards. final indicates only receiving the final result.

Approvals and questions

DSH agent approvals or ask_user_question can be rendered as Lark interactive cards. Users can click buttons to complete allow/deny or select options.

Web-only component degradation

Some dsh-ui interactive fences only render in the Web UI. On the Lark side, they degrade to a single line of readable hints to avoid directly outputting raw JSON.

Use Cases and Notes

Suitable for the following scenarios:

  1. You are already running the DSH agent locally and wish to continue conversations in Lark.
  2. You want different topics/threads in Lark groups to correspond to different DSH sessions.
  3. You need to view the streaming progress of long tasks in Lark.
  4. You want approvals and ask_user_question to be completed via card buttons.
  5. You want to access the DSH agent without exposing a public webhook URL, using Lark long connections.

Notes to be aware of:

  1. This plugin mounts to the DSH profile and runs with the dsh process, so it executes with the current DSH process permissions. It is recommended to check the source code, dependencies, and configuration before installing.
  2. The repository license is MIT.
  3. Typing reactions and card buttons require the bot to interact with messages, relying on the im:message permission. If the reaction API is denied, the gateway will fall back to a hintText message.

Conclusion

The value of kriskwok/dsh-feishu-gateway is to turn Lark into a DSH agent entry point that does not require a public webhook: private chats, group chats, topic isolation, long task progress, approval clicks, and Markdown replies all fall within the Lark message stream.

Repository address:

https://github.com/kriskwok/dsh-feishu-gateway