Skip to content

[Bug]: Feishu Channel Fails to Send Replies Despite Successful Agent Processing #38686

@toretangtang

Description

@toretangtang

Bug type

Regression (worked before, now fails)

Summary

My Feishu channel in OpenClaw is unable to send any replies back to the user. The system successfully receives messages from Feishu, dispatches them to the correct agent, and the agent processes the request and generates a response (visible in the OpenClaw dashboard and session files). However, the final reply is never sent to Feishu.

The most critical log entry, which appears consistently after every attempt, is:
feishu[media-manager]: dispatch complete (queuedFinal=false, replies=0)

This indicates that the reply-dispatcher is concluding that there are no replies to send, even though the agent has generated one. This issue is specific to the Feishu channel, as my WeCom (企业微信) channel works perfectly fine.

Steps to reproduce

  1. Configure a Feishu channel with a valid appId and appSecret.
  2. Bind the Feishu account to an agent (e.g., media-manager).
  3. Send a message to the Feishu bot from a user.
  4. Observe that the message is received by OpenClaw and processed by the agent.
  5. Observe that no reply is sent back to the user in Feishu.
  6. Check the OpenClaw logs and find the dispatch complete (queuedFinal=false, replies=0) entry.

Expected behavior

We have exhaustively debugged this issue and can rule out the following causes:

  1. Configuration Errors: We completely reset the channels.feishu configuration to a minimal, known-good state. The issue persists.
  2. Feishu App Permissions: We have verified that the Feishu app has all necessary permissions, including contact:contact.base:readonly and all im:message scopes. The issue persists.
  3. LLM Output Formatting:
    • We initially suspected that the LLM's output (e.g., " [[reply_to_current]] Hi") was causing a parsing failure due to a leading space.
    • To fix this, we added a hard rule to the agent's AGENTS.md to ensure no leading spaces.
    • When that failed, we added a critical, hard-coded rule to the agent's SOUL.md to never use [[reply_to_current]] or any other reply tags, forcing it to output only plain text.
    • Even with these strict constraints, the replies=0 issue persists, proving the problem is not with the LLM's output format.
  4. Network or API Endpoint Issues:
    • We deliberately set an invalid domain in the Feishu config ("invalid.domain"). This correctly produced a TypeError: Invalid URL error in the logs.
    • This test proves that the message processing logic is attempting to reach the API endpoint, but it's failing before the sendMessageFeishu function is ever called.
  5. Direct Code Instrumentation:
    • We copied the source code of the built-in Feishu plugin into ~/.openclaw/extensions/feishu-debug.
    • We added multiple console.log statements to the sendMessageFeishu function in send.ts.
    • After restarting, we confirmed that none of our custom logs were ever printed, definitively proving that the sendMessageFeishu function is never being called by the reply-dispatcher.

Actual behavior

Conclusion

The root cause of this issue is a bug within the OpenClaw Feishu plugin's reply dispatch logic.

The reply-dispatcher for the Feishu channel is incorrectly determining that there are no replies to send (replies=0), even when the agent has successfully generated a valid response. This happens before the core sendMessageFeishu function is ever invoked.

The fact that the WeCom channel works correctly suggests this is a channel-specific implementation bug, not a core OpenClaw framework issue.

Suggested Next Steps for Developers

Please investigate the createFeishuReplyDispatcher function and its surrounding logic in the Feishu plugin. The problem likely lies in how it parses the agent's final ReplyPayload and decides whether to add it to the queue of messages to be delivered. The logic is erroneously discarding all replies.

OpenClaw version

2026.3.2

Operating system

Linux

Install method

npm

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    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