openclaw - 💡(How to fix) Fix Feature: Auto-resolve Feishu applink to message content [1 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#50987Fetched 2026-04-08 01:05:53
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
referenced ×1

Root Cause

Root Cause:

  • Feishu applink format uses a temporary token that is valid only for the Feishu client to directly open a message
  • This token cannot be converted to a usable message_id for the Feishu API
  • The im:message:send_as_bot and im:message:readonly permissions allow sending/receiving messages, but the applink token itself is a client-side credential

Fix Action

Fix / Workaround

Current Workaround

RAW_BUFFERClick to expand / collapse

Feature Request: Auto-resolve Feishu applink to message content

Problem

When receiving a Feishu message containing an applink (like https://applink.feishu.cn/client/message/link/open?token=xxx), OpenClaw receives the applink string but cannot fetch the actual message content.

Root Cause:

  • Feishu applink format uses a temporary token that is valid only for the Feishu client to directly open a message
  • This token cannot be converted to a usable message_id for the Feishu API
  • The im:message:send_as_bot and im:message:readonly permissions allow sending/receiving messages, but the applink token itself is a client-side credential

Expected Behavior

When a Feishu message contains an applink, OpenClaw should automatically:

  1. Detect the applink in the message
  2. Either:
    • Parse the message to extract the actual linked content (if it's a rich text message with embedded content)
    • OR indicate to the user that the link cannot be automatically resolved
    • OR provide a way to manually trigger content fetch

Current Workaround

Users need to paste the actual message content instead of sending the applink, which is inconvenient.

Technical Context

From Feishu documentation:

  • im.message.receive_v1 event delivers message.content as a JSON string
  • For rich text messages, content includes HTML like <a href="...">link text</a>
  • Reply references use root_id/parent_id to identify quoted messages
  • The applink token is separate from the API-accessible message_id

Feature Request

Consider adding:

  1. Auto-detection of Feishu applinks in received messages
  2. Smart parsing of rich text content to extract embedded link targets
  3. User notification when an applink cannot be resolved
  4. Or documentation clarification on how to handle this scenario

Environment

  • OpenClaw version: latest (2026-03-20)
  • Feishu integration: WebSocket long connection mode
  • Channel: Feishu direct message

Feel free to close this if it's not within OpenClaw's scope, but happy to provide more details if needed.

extent analysis

Fix Plan

To address the issue of auto-resolving Feishu applinks to message content, we will implement the following steps:

  • Auto-detection: Use regular expressions to detect Feishu applinks in received messages.
  • Smart parsing: Parse rich text content to extract embedded link targets.
  • User notification: Notify the user when an applink cannot be resolved.

Example Code

import re
import json

def detect_applink(message):
    # Regular expression to match Feishu applink format
    pattern = r"https://applink\.feishu\.cn/client/message/link/open\?token=([a-zA-Z0-9]+)"
    match = re.search(pattern, message)
    if match:
        return match.group(1)
    return None

def parse_rich_text(content):
    # Parse HTML content to extract embedded link targets
    links = []
    for link in content["content"].find_all("a"):
        links.append(link.get("href"))
    return links

def handle_message(message):
    # Detect Feishu applink in the message
    applink_token = detect_applink(message["content"])
    if applink_token:
        # Parse rich text content to extract embedded link targets
        links = parse_rich_text(message)
        if links:
            # Return the extracted links
            return links
        else:
            # Notify the user that the link cannot be resolved
            return "Unable to resolve applink"
    return message["content"]

# Example usage
message = {
    "content": "https://applink.feishu.cn/client/message/link/open?token=xxx"
}
print(handle_message(message))

Verification

To verify that the fix worked, test the handle_message function with different types of messages, including those with Feishu applinks and rich text content. Check that the function correctly detects and resolves applinks, and notifies the user when an applink cannot be resolved.

Extra Tips

  • Make sure to update the regular expression pattern to match any changes to the Feishu applink format.
  • Consider adding additional error handling and logging to the handle_message function to improve robustness and debugging.
  • Review the Feishu documentation for any updates or changes to the API or message formats.

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 - 💡(How to fix) Fix Feature: Auto-resolve Feishu applink to message content [1 participants]