Skip to content

[Bug] Feishu messages duplicated (retry mechanism lacks deduplication)` #11762

@doudouxiaocai

Description

@doudouxiaocai

🐛 Bug Report

Summary

Feishu messages are being sent 2-3 times, severely affecting user experience

Reproduction Steps

User sends a message
Agent generates a response
Call Feishu API to send
System returns permission-error
System automatically retries and generates response again
Calls API again
Loop repeats 2-3 times
User receives multiple duplicate messages

Expected Behavior

When API call fails, it should:
Reuse the previously generated response
Or mark as "processed" to avoid regenerating
User should only receive 1 message

Actual Behavior

Each retry regenerates a complete response
User receives 2-3 duplicate messages
Accompanied by permission-error

Error Messages

[System: The bot encountered a Feishu API permission error.
Permission grant URL: https://open.feishu.cn/app/cli_a90aa59c71771bd7/auth?q=contact:contact.base:readonly]
[message_id: om_xxx:permission-error]

Root Cause Analysis

Hypothesis: Feishu plugin retry mechanism in OpenClaw has a flaw

Issues:
❌ No check for "same message" during retry
❌ Each retry regenerates response (instead of reusing)
❌ No message deduplication mechanism

Environment

Channel: Feishu
Error Frequency: Intermittent but frequent (30-50% of messages)
Actual Success Rate: Most messages eventually succeed

Priority

Medium-High - While functionality works, it severely impacts UX

Suggested Fix

// Add message deduplication
if (messageAlreadyProcessed(messageId)) {
resendCachedResponse();
} else {
generateAndCacheResponse();
markAsProcessed(messageId);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions