← Back to Plugins
Tools

Plugin Feishu Auto Notify

JingWang-Star996 By JingWang-Star996 👁 53 views ▲ 0 votes

OpenClaw plugin for automatic Feishu notifications when subagents complete

GitHub

Install

npm install openclaw-plugin-feishu-auto-notify

Configuration Example

{
  "plugins": {
    "entries": {
      "feishu-auto-notify": {
        "enabled": true,
        "config": {
          "notifyOnComplete": true,
          "wakeMainSession": true,
          "notifyTargets": [
            {
              "channel": "feishu",
              "userId": "ou_xxxxx"
            }
          ]
        }
      }
    }
  }
}

README

# 🚀 OpenClaw Feishu Auto Notify Plugin

[English](#english) | [中文](#中文)

---

<a id="english"></a>
## 🇬🇧 English

### Overview

Automatically send Feishu (Lark) notifications and wake the main session when subagents complete their tasks.

### Problem

OpenClaw's Feishu channel has a limitation: when a subagent completes its task, the announce result cannot be automatically delivered to the Feishu DM channel, causing conversation interruption. Users need to manually send a message to continue the conversation.

This plugin solves this by listening to the `subagent_ended` event and proactively sending Feishu messages + waking the main session.

### Features

- ✅ **Automatic Notification**: Send Feishu messages when subagents complete
- ✅ **Session Wake**: Automatically wake the main session for multi-turn conversations
- ✅ **Multi-Target Support**: Notify multiple users/groups simultaneously
- ✅ **Flexible Configuration**: Configure notification content, targets, and triggers
- ✅ **Error Handling**: Built-in retry mechanism and error logging

### Installation

```bash
openclaw plugins install /path/to/feishu-auto-notify
```

Or via npm:

```bash
npm install openclaw-plugin-feishu-auto-notify
```

### Configuration

Add to your `openclaw.json`:

```json
{
  "plugins": {
    "entries": {
      "feishu-auto-notify": {
        "enabled": true,
        "config": {
          "notifyOnComplete": true,
          "wakeMainSession": true,
          "notifyTargets": [
            {
              "channel": "feishu",
              "userId": "ou_xxxxx"
            }
          ]
        }
      }
    }
  }
}
```

### Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `enabled` | boolean | `true` | Enable/disable the plugin |
| `notifyOnComplete` | boolean | `true` | Send notification when subagent completes |
| `wakeMainSession` | boolean | `true` | Wake main session after notification |
| `notifyTargets` | array | `[]` | List of notification targets |

### notifyTargets Format

```json
{
  "channel": "feishu",
  "userId": "ou_xxxxx",
  "chatId": "oc_xxxxx",
  "messageTemplate": "✅ Task completed: {taskName}\n{summary}"
}
```

- `channel`: Notification channel (feishu)
- `userId`: User ID for private chat
- `chatId`: Group ID for group chat (mutually exclusive with userId)
- `messageTemplate`: Message template (optional)

### Usage

Once installed and configured, the plugin will automatically:

1. **Monitor** all subagent completion events
2. **Send** Feishu notifications to configured targets
3. **Wake** the main session to continue conversation

No manual intervention required.

### Development

```bash
# Install dependencies
npm install

# Run tests
npm test

# Local development link
npm link
```

### License

MIT

### Author

王鲸

---

<a id="中文"></a>
## 🇨🇳 中文

### 概述

自动在子代理完成任务时发送飞书通知并唤醒主会话。

### 问题背景

OpenClaw 的飞书通道存在一个问题:子代理完成任务后,announce 结果无法自动投递到飞书 DM 通道,导致对话中断。用户需要手动发送消息才能继续对话。

本插件通过监听 `subagent_ended` 事件,主动发送飞书消息并唤醒主会话,解决这一问题。

### 功能特性

- ✅ **自动通知**:子代理完成任务后自动发送飞书消息
- ✅ **会话唤醒**:自动唤醒主会话,支持多轮对话
- ✅ **多目标支持**:支持同时通知多个用户/群组
- ✅ **灵活配置**:可配置通知内容、目标、触发条件
- ✅ **错误处理**:内置重试机制和错误日志

### 安装方法

```bash
openclaw plugins install /path/to/feishu-auto-notify
```

或通过 npm:

```bash
npm install openclaw-plugin-feishu-auto-notify
```

### 配置说明

在 `openclaw.json` 中添加配置:

```json
{
  "plugins": {
    "entries": {
      "feishu-auto-notify": {
        "enabled": true,
        "config": {
          "notifyOnComplete": true,
          "wakeMainSession": true,
          "notifyTargets": [
            {
              "channel": "feishu",
              "userId": "ou_xxxxx"
            }
          ]
        }
      }
    }
  }
}
```

### 配置项说明

| 配置项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `enabled` | boolean | `true` | 启用/禁用插件 |
| `notifyOnComplete` | boolean | `true` | 子代理完成时是否发送通知 |
| `wakeMainSession` | boolean | `true` | 是否唤醒主会话 |
| `notifyTargets` | array | `[]` | 通知目标列表 |

### notifyTargets 格式

```json
{
  "channel": "feishu",
  "userId": "ou_xxxxx",
  "chatId": "oc_xxxxx",
  "messageTemplate": "✅ 任务完成:{taskName}\n{summary}"
}
```

- `channel`: 通知渠道(feishu)
- `userId`: 用户 ID(私聊)
- `chatId`: 群组 ID(群聊,与 userId 二选一)
- `messageTemplate`: 消息模板(可选)

### 使用方法

安装并配置完成后,插件会自动:

1. **监控**所有子代理的完成事件
2. **发送**飞书通知到配置的目标
3. **唤醒**主会话,支持继续对话

无需手动干预。

### 开发说明

```bash
# 安装依赖
npm install

# 运行测试
npm test

# 本地开发链接
npm link
```

### 许可证

MIT

### 作者

王鲸

### 贡献

欢迎贡献代码!请在 GitHub 上提交 Issue 或 PR。
tools

Comments

Sign in to leave a comment

Loading comments...