Introduction¶
DeepSeek Harness (DSH) connects agent capabilities to instant messaging channels, typically requiring developers to manually integrate with the Feishu (Lark) API, handle session management, context injection, and card rendering. The czwjss/feishu-bot-im plugin provides a unified entry point in the DSH sidebar, allowing developers to treat Feishu Bot IM as a “client” of DSH — dispatching tasks in chat, observing execution progress, and collecting result files.
What Is It¶
czwjss/feishu-bot-im is a DSH plugin categorized under “Client.” Maintained by czwjss, the plugin integrates Feishu Bot IM as a DSH client, supporting multi-bot management, QR-code authorization, session binding, card-based streaming replies, and user avatar (operating Feishu on behalf of the user), among other features.
Installation & Enablement¶
Install @czwjss/feishu-bot-im from the DSH plugin settings, or use the plugin manager:
@czwjss/feishu-bot-im
To enable from source, first clone the repository and install dependencies:
git clone https://github.com/czwjss/feishu-bot-im.git
cd feishu-bot-im
pnpm install # or npm install
Then enable the local directory in the DSH Web plugin settings.
Steps to connect to Feishu:
- Open the “Feishu Bot IM” entry in the sidebar, and choose QR-code scan or manual add;
- Scan the QR code with Feishu to confirm (or manually enter App ID / Secret);
- Scanning automatically requests the required permissions (message send/receive, resource upload, group info read, etc.);
- Send a message in a Feishu private chat, or @the bot in a group to start.
Core Features¶
Multi-Bot & Independent Management¶
The plugin provides a “Feishu Bot IM” entry in the DSH sidebar. Select a bot first, then manage its sessions, bindings, avatar, configuration, and status. Multiple Feishu bots can be connected to a single DSH instance, each with independent connections, configurations, and session bindings.
Default Permissions for New Sessions¶
Under Bot Settings → General, choose the permission tier for new sessions: Follow Host Default / View Only / Workspace Modify / Full Access, etc.
QR-Code Onboarding & Permission Completion¶
The main interface generates a QR code. After scanning with Feishu, the app is created, permissions are auto-completed, and the bot goes online. Manual App ID / Secret entry is also supported. On the “Status” page, click “Complete Permissions” to scan and authorize.
Chat as Work¶
- Private chat for direct conversation;
- In group chats, @the bot or quote a bot message to dispatch tasks;
- Quoted messages capture the original text as context;
- Quoted images and images embedded in cards are downloaded as native image attachments.
Card Streaming Replies¶
Reply cards use CardKit for typewriter-style output; tool-call / Token panels update per-component during streaming. When CardKit is unavailable, it automatically falls back to plain cards.
Process Visibility¶
Reply cards can separately display tool calls (duration, parameters, failure reasons) and Token / context statistics; both are off by default. The menu always shows the current session’s Token / context statistics, and each of these two card panels can be toggled on individually from the menu.
Group Chat Eavesdropping¶
Enabled by default. Records the most recent 20 messages that did not @you as context (configurable, max 500), and auto-appends them the next time you are @’d. Images / files are recorded as placeholders; images can be read on demand via the history tool. Requires the im:message.group_msg permission, which can be enabled in the Feishu Developer Console or by clicking “Complete Permissions” on the bot’s “Status” page to scan and authorize.
@-Mention Capability¶
Enabled by default. Use @-mentions when someone’s decision, approval, confirmation, or selection is needed. Do not @ for pure information sharing or small talk, and do not @ when the specific person is uncertain. The model directly outputs <at id=[open_id]></at> which is replaced with the full open_id; the plugin validates and either retains or erases it. @everyone is prohibited by default.
Approvals & Questions¶
Approve / reject or pick an answer directly in Feishu.
File Exchange¶
Images and files can be sent to the bot; the bot can also return files.
Context Injection¶
Each message carries source information such as group name and speaker, while the user bubble remains clean.
Proactive Delivery¶
Use feishu_bot_chats to find the bot’s groups and exact chat IDs, then use feishu_bot_send to deliver a standalone card or file. Text cards support title for the heading and color for heading color; omitting chatId sends to the Feishu group bound to the current session.
Querying Message History¶
feishu_bot_messages reads history by session and time range, or by thread; a single message can be fetched by messageId (merged-forward messages are fully expanded with sub-messages). Optional local keyword filtering is available (not a Feishu full-text search). Returns full body text, message IDs, and pagination cursors. The bot requires the im:message.group_msg permission.
Message Attachments¶
feishu_message_attachment uniformly reads original images from history messages (read_image) or downloads historical file attachments to the current workspace (download_file, refused under a read-only sandbox).
User Identity (Feishu Avatar)¶
The plugin operates Feishu on your behalf, providing 14 model tools, including:
feishu_avatar_chats / feishu_avatar_people / feishu_avatar_messages / feishu_avatar_send / feishu_avatar_recallfeishu_avatar_doc_read / feishu_avatar_doc_write / feishu_avatar_doc_file
These tools reuse a bot’s App ID / App Secret, connecting via device authorization without requiring a redirect URL. Avatar documentation: Usage & Troubleshooting · Development Architecture · Monitoring & Dispatch Rules · Permission List. For full input, output, and boundary details of all tools, see the Tool Contract.
Embedded Worker Sessions¶
The avatar page uses a two-pane layout with a session list and native conversation view. Select a session to view its Worker directly. Per-session monitoring settings and message details open in a drawer; historical Workers can be viewed inline or “opened independently.”
Session Binding¶
From session details, search for and bind to an existing DSH session, or change / remove the binding. The selected session’s history, model, and workspace are preserved; the binding operation sends no messages, and subsequent trigger messages enter the selected session. Sessions occupied by other chats, avatar Workers, and running sessions are not selectable.
Session Naming¶
Bot sessions are named after the chat name upon first creation; avatar Workers use the monitored session name and are re-named after rebuild.
Human Handoff¶
Keywords can be configured under Feishu Bot IM → Select Bot → Status → Avatar Status → Auto-Reply Settings (defaults: “transfer to human / human support / find a real person / I want to file a complaint”). When matched, the bot stays silent, the avatar discards the current batch, and waits for a human to handle it.
Avatar Message Monitoring¶
Under Feishu Bot IM → Select Bot → Avatar, add group chats individually, or enable the disabled-by-default “Monitor All Private Chats.” Once monitoring starts, new messages are polled on your behalf and batched to the Worker. Private chats are auto-discovered via the Feishu session directory; group chats process @me / reply-to-me by default, with configurable trigger rules.
Auto-Save Settings¶
Bot configurations and avatar reply rules are saved automatically after modification; dropdowns and toggles submit instantly, text fields submit 600 ms after typing stops, and on failure the draft is preserved with retry support.
Status & Connection Management¶
The Status page centrally displays app info, runtime observability, and avatar authorization (including expiration time). When a bot is connected, editable configuration is shown; after valid avatar authorization, auto-reply settings are displayed. Connection diagnostics, refresh, reconnect, and permission completion are all text buttons with a 2-second hover tooltip. Diagnostics only validate credentials and connection status without sending messages; refresh only updates the session directory and status without reconnecting or fetching new avatar messages. The “…” on the right expands to a delete entry, requiring a secondary confirmation to remove the current bot.
Avatar Reply Rules¶
Under Feishu Bot IM → Select Bot → Status → Avatar Status → Auto-Reply Settings, edit reply rules or restore the default template; session info and rules are injected separately via the Worker’s dedicated dynamic context, and new messages with background records are delivered as user messages. Rules take effect from the next model request after saving.
Common Commands¶
| Command | Function |
|---|---|
/menu |
Four dropdowns to select session / workspace / model / thinking intensity; always displays the current session’s Token usage and context occupancy; two independent toggles control the Token statistics and tool-call panels on reply cards (both off by default); buttons: New Session, Compact, Adjust, Close |
/new |
Start a completely fresh session |
/stop |
Stop the current task |
Usage Tips¶
- In group chats, only @the bot or quoting a bot message triggers a reply; eavesdropping is on by default and only supplements context without triggering a reply;
- In-group @-mention is on by default, @everyone is prohibited by default; adjustable in group chat settings; malformed @-tags are erased;
- To run parallel tasks in a group, open a new session from the bot menu, or use separate Web sessions;
- In-group
/new,/stop, config adjustments, and approval buttons require an admin whitelist member by default; regular tasks and question selections are unrestricted; - When a Feishu chat is bound to a Web session, tasks on the Web side do not push cards or approvals to Feishu; use
feishu_bot_sendwhen you need to send a message.
Use Cases & Cautions¶
Ideal for developers who need to dispatch tasks directly in Feishu, observe execution progress, and collect result files. The plugin runs with the current DSH process privileges — review the source code and license before installation.
In Short¶
Turn Feishu chat into your DSH workbench: QR-code onboarding, multi-bot support, session binding, card streaming replies, and user avatar. Browse the catalog and source code:
https://www.skillhub.cn/plugins/czwjss/feishu-bot-im
https://github.com/czwjss/feishu-bot-im