Skip to content

Commit 0da34a2

Browse files
Ericclaude
authored andcommitted
fix(feishu): suppress NO_REPLY silent token before Feishu API send
The Feishu channel was missing SILENT_REPLY_TOKEN filtering that other channels (e.g. MSTeams) already implement. When an agent delivered a message via a plugin and replied with NO_REPLY, the token was sent as real text to the Feishu API, triggering a "Message failed" error. Add isSilentReplyText checks in both the outbound adapter (sendText) and the reply dispatcher (deliver) to suppress the token before it reaches the Feishu API. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent aae75b5 commit 0da34a2

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎extensions/feishu/src/outbound.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from "fs";
22
import path from "path";
3+
import { isSilentReplyText, SILENT_REPLY_TOKEN } from "openclaw/plugin-sdk";
34
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/feishu";
45
import { resolveFeishuAccount } from "./accounts.js";
56
import { sendMediaFeishu } from "./media.js";
@@ -82,6 +83,11 @@ export const feishuOutbound: ChannelOutboundAdapter = {
8283
chunkerMode: "markdown",
8384
textChunkLimit: 4000,
8485
sendText: async ({ cfg, to, text, accountId, replyToId, threadId, mediaLocalRoots }) => {
86+
// Suppress NO_REPLY silent token — already delivered via another channel/plugin.
87+
if (!text?.trim() || isSilentReplyText(text.trim(), SILENT_REPLY_TOKEN)) {
88+
return { channel: "feishu", messageId: "suppressed", channelId: to };
89+
}
90+
8591
const replyToMessageId = resolveReplyToMessageId({ replyToId, threadId });
8692
// Scheme A compatibility shim:
8793
// when upstream accidentally returns a local image path as plain text,

‎extensions/feishu/src/reply-dispatcher.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isSilentReplyText, SILENT_REPLY_TOKEN } from "openclaw/plugin-sdk";
12
import {
23
createReplyPrefixContext,
34
createTypingCallbacks,
@@ -254,6 +255,11 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP
254255
return;
255256
}
256257

258+
// Suppress NO_REPLY silent token — already delivered via another channel/plugin.
259+
if (shouldDeliverText && !hasMedia && isSilentReplyText(text, SILENT_REPLY_TOKEN)) {
260+
return;
261+
}
262+
257263
if (shouldDeliverText) {
258264
const useCard = renderMode === "card" || (renderMode === "auto" && shouldUseCard(text));
259265

0 commit comments

Comments
 (0)