openclaw - ✅(Solved) Fix [Feature]: Feishu Message Recall Support [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#51422Fetched 2026-04-08 01:11:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1labeled ×1referenced ×1

Fix Action

Fixed

PR fix notes

PR #52993: feat(feishu): add message recall and delete support (#51422)

Description (problem / solution / changelog)

Closes #51422

Summary

Add message recall support to Feishu plugin.

Changes

  • Add feishu_message tool with list/recall/delete actions
  • Implement message-schema.ts with Zod schema validation
  • Implement message.ts with Feishu API integration
  • Add comprehensive unit tests (8 tests)
  • Update types.ts and tools-config.ts

Features

  • Support listing messages with optional time range filtering
  • Support recalling messages (Feishu API limit: 2 minutes)
  • Support deleting messages
  • Configurable via tools.message option

Testing

  • Unit tests: 8/8 passing
  • All existing Feishu tests: 415/415 passing

Reference

Changed files

  • extensions/feishu/index.test.ts (modified, +6/-0)
  • extensions/feishu/index.ts (modified, +2/-0)
  • extensions/feishu/src/bitable.ts (modified, +6/-4)
  • extensions/feishu/src/bot.test.ts (modified, +25/-5)
  • extensions/feishu/src/bot.ts (modified, +4/-1)
  • extensions/feishu/src/docx.ts (modified, +26/-26)
  • extensions/feishu/src/media.test.ts (modified, +2/-2)
  • extensions/feishu/src/media.ts (modified, +10/-8)
  • extensions/feishu/src/message-schema.ts (added, +34/-0)
  • extensions/feishu/src/message.test.ts (added, +95/-0)
  • extensions/feishu/src/message.ts (added, +191/-0)
  • extensions/feishu/src/send-result.ts (modified, +2/-1)
  • extensions/feishu/src/tools-config.ts (modified, +2/-1)
  • extensions/feishu/src/types.ts (modified, +1/-0)
  • extensions/feishu/src/wiki.ts (modified, +6/-6)
RAW_BUFFERClick to expand / collapse

Summary

Feature Description

Add message recall support to Feishu plugin.

Background

A user needs to recall a bot message that leaked their IP address in a Lark group chat.

Existing Permission

OpenClaw Feishu app already has "im:message:recall" permission.

Expected

  • Read group messages (im:message.group_msg:readonly)
  • Recall messages (im:message:recall)
  • Delete messages

Reference

https://open.feishu.cn/document/server-docs/im-v1/message-content-description/delete_json

Problem to solve

Users cannot recall messages in Feishu group chats through OpenClaw, even when the bot accidentally leaks sensitive information (such as IP addresses). This poses a privacy risk and limits the functionality of the Feishu integration.

Proposed solution

Add new Feishu tools to support message management:

  1. feishu_message_list - List/group messages in a chat

    • Input: chat_id, optional time range
    • Output: message list with content, sender, timestamp
  2. feishu_message_recall - Recall a specific message

    • Input: message_id, chat_id
    • Output: success/failure status
  3. feishu_message_delete - Delete a message

    • Input: message_id, chat_id
    • Output: success/failure status

These tools should use the existing "im:message:recall" and "im:message.group_msg:readonly" permissions that are already granted to the OpenClaw Feishu app.

Alternatives considered

No response

Impact

Impact

  • Affected users/systems/channels:

    • Users who use OpenClaw with Feishu integration
    • Feishu group chats where bots are present
    • Privacy-sensitive workflows
  • Severity:

    • High - This is a privacy/security issue. Users' sensitive information (IP addresses, system details) can be exposed in group chats and cannot be retracted.
  • Frequency:

    • Intermittent - Occurs whenever a bot is queried for user information in group chats without proper access controls.
  • Consequence:

    • Privacy leakage that cannot be reversed once messages are sent
    • Potential compliance/regulatory issues for enterprise users
    • Users must manually request admins to delete messages, causing delays and requiring extra manual work

Reference

https://open.feishu.cn/document/server-docs/im-v1/message-content-description/delete_json

Evidence/examples

No response

Additional information

No response

extent analysis

Fix Plan

To address the issue of recalling messages in Feishu group chats, we will implement the proposed solution by adding three new Feishu tools: feishu_message_list, feishu_message_recall, and feishu_message_delete.

Step-by-Step Solution

  • Implement feishu_message_list to list group messages in a chat:
    • Use the im:message.group_msg:readonly permission to fetch messages.
    • Handle optional time range input.
    • Return a message list with content, sender, and timestamp.
  • Implement feishu_message_recall to recall a specific message:
    • Use the im:message:recall permission to recall the message.
    • Take message_id and chat_id as input.
    • Return success or failure status.
  • Implement feishu_message_delete to delete a message:
    • Use the im:message:recall permission to delete the message.
    • Take message_id and chat_id as input.
    • Return success or failure status.

Example Code (Python)

import requests

def feishu_message_list(chat_id, time_range=None):
    url = f"https://open.feishu.cn/open-apis/im/v1/messages?chat_id={chat_id}"
    if time_range:
        url += f"&timestamp={time_range['start']}&timestamp={time_range['end']}"
    response = requests.get(url, headers={"Authorization": "Bearer YOUR_TOKEN"})
    return response.json()

def feishu_message_recall(message_id, chat_id):
    url = f"https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/recall"
    data = {"chat_id": chat_id}
    response = requests.post(url, json=data, headers={"Authorization": "Bearer YOUR_TOKEN"})
    return response.json()

def feishu_message_delete(message_id, chat_id):
    url = f"https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/delete"
    data = {"chat_id": chat_id}
    response = requests.post(url, json=data, headers={"Authorization": "Bearer YOUR_TOKEN"})
    return response.json()

Replace YOUR_TOKEN with your actual Feishu app token.

Verification

To verify the fix, test the feishu_message_list, feishu_message_recall, and feishu_message_delete functions with different inputs and scenarios. Ensure that the functions return the expected results and that messages are successfully recalled or deleted.

Extra Tips

  • Make sure to handle errors and exceptions properly in your implementation.
  • Use logging to monitor and debug your functions.
  • Consider adding additional features, such as message filtering or sorting, to enhance the functionality of your Feishu integration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: Feishu Message Recall Support [1 pull requests, 1 comments, 2 participants]