Foreword

DeepSeek Harness (DSH) consolidates models, tools, system prompts, and session storage within a single Host. Daily development is typically conducted via a web client or terminal. However, team communication often happens on Feishu or Lark—if you want colleagues to directly query an Agent in a chat window, the common approach is to build a custom Bot service, configure a public Webhook, and then forward messages to the backend. This results in a long chain, high deployment barriers, and often requires additional work to open callback addresses in intranet or local development environments.

@sugarforever/dsh-lark is a community-maintained DSH Host plugin, released by sugarforever and categorized as “Model Inference” on SkillHub. It uses the official Feishu @larksuiteoapi/node-sdk Channel API to receive messages via a WebSocket long connection, maps Feishu conversations to Harness Sessions, and hands them over to the configured Agent for processing. After installation, users can interact in Feishu direct messages, group chats, or topics while utilizing the models, tools, and Presets from Harness, without needing to set up a separate public callback service.

What This Is

@sugarforever/dsh-lark (npm package name, current version 0.2.2, MIT license) is a Feishu/Lark channel plugin for DeepSeek Harness. The plugin handles session mapping and message forwarding; connection management, automatic reconnection, message deduplication, format conversion, and reply sending are handled by the official SDK.

Compared to a “custom intermediate service + Webhook” setup, the long connection mode allows the plugin to proactively connect to Feishu, enabling it to run on local computers, intranet machines, or environments without a public entry point.

Core Features

The following capabilities are derived from the project’s README and package.json description:

  • Supports Feishu China (domain: feishu) and international Lark (domain: lark).
  • Receives im.message.receive_v1 events via WebSocket long connection, requiring no public server, domain, or Webhook address.
  • Reuses Harness Sessions per chat for direct messages and normal group chats; uses independent sessions per chat_id + thread_id for topic groups.
  • Replies are linked to the original message and remain within the corresponding topic thread.
  • Group chats require @bot by default (requireMention: true); direct messages are open by default (dmMode: open).
  • Supports restricting group chat and direct message users via groupAllowlist and dmAllowlist; direct messages can also be set to disabled.
  • Can inherit the Harness default model or specify a separate model for the Feishu channel via provider and model.
  • Session identifiers are processed with SHA-256, ensuring the original chat_id is not written into the Session ID.
  • Internal Harness errors are not directly sent to Feishu users; errorMessage can be configured.
  • Supports configuration via the Settings page, profile patch, or environment variables; credentials and App Secrets are stored separately.

Prerequisites

Before installation, ensure the environment meets the conditions listed in the README:

  • Node.js ^22.19.0 or >=24.0.0.
  • DeepSeek Harness 0.1.0-rc.6 or any higher 0.1.x version installed or runnable via npx.
  • A Feishu or Lark custom app with bot capability enabled, subscribed to im.message.receive_v1, and with “Receive events via long connection” selected.

If Harness has not been run before, start the Web Profile to create the default configuration directory:

npx @deepseek-ai/dsh web

The first launch creates the web Profile, typically located at ~/.dsh/profiles/web; if DSH_HOME is set, it will be at $DSH_HOME/profiles/web.

Creating a Feishu App

This section describes the configuration needed in the Feishu or Lark developer console. Console names may vary slightly between the China and international versions; permission identifiers are based on the documentation.

Recording Credentials

  1. Create a custom enterprise app, providing a name, description, and icon.
  2. In “Credentials & Basic Information,” record the App ID and App Secret.

Do not write the App Secret into YAML files in your repository. It should be saved later via the Harness Settings page or passed in via environment variables.

Enabling Bot and Permissions

  1. In “Add App Capability,” add “Bot,” setting a name and avatar.
  2. Enable the following permissions (the minimum set required for default behavior):
Permission Identifier Purpose
im:message.p2p_msg:readonly Receive direct messages
im:message.group_at_msg:readonly Receive @bot messages in group chats
im:message:send_as_bot Send replies as the bot

If the console supports bulk import, use the scopes JSON provided in the README. After importing, you still need to add im.message.receive_v1 in event subscriptions and publish a new version.

To set requireMention to false and process messages not @bot in groups, you must also apply for im:message.group_msg, which typically requires enterprise admin approval.

Configuring Long Connection Events

  1. Go to “Events & Callbacks” or “Event Subscriptions.”
  2. Select “Receive events via long connection” and do not fill in a Webhook address.
  3. Add the event im.message.receive_v1 and save.
  4. Create an app version, publish or install it to a test enterprise, and find the bot in Feishu to start a direct message or add it to a group chat.

Installation and Enabling

Install from npm into the Harness Web Profile:

npx @deepseek-ai/dsh plugin --profile web add @sugarforever/dsh-lark

List installed plugins:

npx @deepseek-ai/dsh plugin --profile web list

The plugin remains enabled after installation; it will not establish a Feishu connection until the App ID and App Secret are configured, allowing you to install the plugin first and fill in credentials via the UI.

Start Harness:

npx @deepseek-ai/dsh web

Open Settings, select Feishu & Lark, and configure App ID, App Secret, domain (feishu or lark), access policies, and Agent parameters. Provider and Model are from the Harness model directory; if left empty, they follow the Harness default configuration.

After saving, regular parameters are written to the lark-channel section in $DSH_HOME/settings.yaml; the App Secret is stored via Harness Credentials in $DSH_HOME/.credentials.yaml and is not echoed back to the browser. After configuration or credential changes, the plugin closes the old WebSocket and rebuilds the channel, usually without needing to restart Harness.

For container or CI scenarios, the Secret can be passed via environment variable (default reference name DSH_LARK_APP_SECRET, frozen at startup; modifications require restarting the process):

export DSH_LARK_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
npx @deepseek-ai/dsh web

Basic configuration can also be provided in a profile patch (avoid inserting duplicate lark-channel instances with the same id):

- id: lark-channel
  config:
    appId: cli_xxxxxxxxxxxxxxxx
    appSecretRef: DSH_LARK_APP_SECRET
    domain: feishu

When connected, the terminal will display dsh-lark: WebSocket connected; if the network disconnects, the SDK will attempt to reconnect and output corresponding logs.

Typical Usage

Direct Message Verification

  1. Open the bot in Feishu and send a plain text message.
  2. Wait for Harness to complete the current Agent turn.
  3. The bot replies with the assistant text generated in that turn; subsequent messages in the same direct message reuse the same Session, preserving context.

Group Chat Verification

  1. Add the bot to a group chat.
  2. Use @bot followed by a question to send.
  3. The bot replies to the message that triggered it. By default, group messages without @bot are ignored.

Topic Groups

Messages within a topic use an independent Session; different topics do not share records. Replies remain in the original topic thread.

Access Control Examples

Allow only specific groups:

requireMention: true
groupAllowlist:
  - oc_group_one
  - oc_group_two

Allow only specific users to direct message:

dmMode: allowlist
dmAllowlist:
  - ou_user_one
  - ou_user_two

Disable direct messages completely:

dmMode: disabled

Fixed Workspace and Preset

If you want the bot to always operate in a specific project directory, you can explicitly configure:

workspace: /absolute/path/to/workspace
agentPreset: coding

If workspace is not configured, the first entry in the Harness Workspace list is used; if agentPreset is not configured, the current default Harness Preset is used. It is recommended to set both provider and model; otherwise, the Harness default model is followed.

For complete configuration options, refer to the lark-channel example in the README, which includes fields like errorMessage (text returned to the user when the Agent fails, up to 500 characters).

Applicable Scenarios and Considerations

Who It’s For

  • Teams already using DSH to manage Agents, models, and tools, who want their team to interact directly in Feishu/Lark with the same configuration.
  • Environments where maintaining a public Webhook is not possible or desired, but DSH can run long-term on a local machine or intranet.
  • Scenarios requiring whitelisting by group or user, or specifying models and coding Presets for the Feishu channel.

Before Use, Please Note

  • The plugin runs with the user permissions of the current DSH process; the Agent’s accessible workspace and tool capabilities depend on that process’s configuration. Before installation, read the source code and MIT license to ensure it meets organizational security requirements.
  • Do not commit the App Secret to version control; prefer using Settings or DSH_LARK_APP_SECRET to manage credentials.
  • Permission changes may require enterprise admin approval; if the bot can join a group but doesn’t receive messages, first check if permissions and event subscriptions are published and active.
  • SkillHub is an independent DSH plugin community directory, not officially affiliated with DeepSeek/High-Flyer; plugins are community-maintained, with the GitHub repository currently having around 24 stars and 6 forks.
  • Compatible with Harness 0.1.x starting from 0.1.0-rc.6; for major version upgrades, pay attention to Session version notes in the README and CHANGELOG.

Conclusion

With the steps above, @sugarforever/dsh-lark connects Feishu chat windows to Harness Sessions and Agents: long connections eliminate public callbacks, session and topic mappings are clear, and configuration can be done via UI, patches, or environment variables. If you’re already using DSH for intelligent agent development, this plugin provides a relatively straightforward IM integration path.