Repository navigation
Conversation
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]>
Greptile SummaryThis PR adds
Confidence Score: 3/5
|
| if (shouldDeliverText && !hasMedia && isSilentReplyText(text, SILENT_REPLY_TOKEN)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
NO_REPLY text not suppressed when media is also present
The !hasMedia guard means that when a payload carries both NO_REPLY text and media, the early-return is skipped and execution falls straight through to the if (shouldDeliverText) block (line 263), which calls sendMarkdownCardFeishu / sendMessageFeishu with the literal string "NO_REPLY" — exactly the bug this PR is trying to fix.
The intent described in the PR ("Messages with media + NO_REPLY text still deliver the media") requires the text to be suppressed while still delivering the media, not skipping the suppression entirely.
A safer pattern mirrors what the pre-existing empty-text guard already does: derive an effective shouldDeliverText that accounts for the silent token, then let the rest of the function use it:
// Suppress NO_REPLY silent token — already delivered via another channel/plugin.
const isSilentText = shouldDeliverText && isSilentReplyText(text, SILENT_REPLY_TOKEN);
if (isSilentText && !hasMedia) {
return;
}
if (shouldDeliverText && !isSilentText) {
// ... existing text delivery logic
}
With this approach, NO_REPLY-only payloads still short-circuit, while mixed payloads skip the text but continue to the hasMedia block.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/feishu/src/reply-dispatcher.ts
Line: 259-261
Comment:
**`NO_REPLY` text not suppressed when media is also present**
The `!hasMedia` guard means that when a payload carries both `NO_REPLY` text *and* media, the early-return is skipped and execution falls straight through to the `if (shouldDeliverText)` block (line 263), which calls `sendMarkdownCardFeishu` / `sendMessageFeishu` with the literal string `"NO_REPLY"` — exactly the bug this PR is trying to fix.
The intent described in the PR ("Messages with media + `NO_REPLY` text still deliver the media") requires the *text* to be suppressed while still delivering the media, not skipping the suppression entirely.
A safer pattern mirrors what the pre-existing empty-text guard already does: derive an effective `shouldDeliverText` that accounts for the silent token, then let the rest of the function use it:
```
// Suppress NO_REPLY silent token — already delivered via another channel/plugin.
const isSilentText = shouldDeliverText && isSilentReplyText(text, SILENT_REPLY_TOKEN);
if (isSilentText && !hasMedia) {
return;
}
if (shouldDeliverText && !isSilentText) {
// ... existing text delivery logic
}
```
With this approach, `NO_REPLY`-only payloads still short-circuit, while mixed payloads skip the text but continue to the `hasMedia` block.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Pull request overview
This PR prevents Feishu outbound sends from accidentally posting the NO_REPLY / SILENT_REPLY_TOKEN marker as real text, aligning Feishu with other channels’ silent-reply handling and avoiding Feishu API “Message failed” errors.
Changes:
- Add a NO_REPLY suppression guard in Feishu outbound
sendText. - Add a NO_REPLY suppression guard in the Feishu reply dispatcher
deliverpath.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
extensions/feishu/src/outbound.ts |
Adds early suppression for silent-reply token before calling Feishu send APIs. |
extensions/feishu/src/reply-dispatcher.ts |
Skips delivering text-only silent replies before they reach the Feishu send APIs. |
You can also share your feedback on Copilot code review. Take the survey.
| sendText: async ({ cfg, to, text, accountId, replyToId, threadId, mediaLocalRoots }) => { | ||
| // Suppress NO_REPLY silent token — already delivered via another channel/plugin. | ||
| if (!text?.trim() || isSilentReplyText(text.trim(), SILENT_REPLY_TOKEN)) { | ||
| return { channel: "feishu", messageId: "suppressed", channelId: to }; | ||
| } |
| @@ -1,5 +1,6 @@ | |||
| import fs from "fs"; | |||
| import path from "path"; | |||
| import { isSilentReplyText, SILENT_REPLY_TOKEN } from "openclaw/plugin-sdk"; | |||
| // Suppress NO_REPLY silent token — already delivered via another channel/plugin. | ||
| if (shouldDeliverText && !hasMedia && isSilentReplyText(text, SILENT_REPLY_TOKEN)) { | ||
| return; | ||
| } |
| // Suppress NO_REPLY silent token — already delivered via another channel/plugin. | ||
| if (shouldDeliverText && !hasMedia && isSilentReplyText(text, SILENT_REPLY_TOKEN)) { | ||
| return; | ||
| } |
| @@ -1,3 +1,4 @@ | |||
| import { isSilentReplyText, SILENT_REPLY_TOKEN } from "openclaw/plugin-sdk"; | |||
| sendText: async ({ cfg, to, text, accountId, replyToId, threadId, mediaLocalRoots }) => { | ||
| // Suppress NO_REPLY silent token — already delivered via another channel/plugin. | ||
| if (!text?.trim() || isSilentReplyText(text.trim(), SILENT_REPLY_TOKEN)) { | ||
| return { channel: "feishu", messageId: "suppressed", channelId: to }; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0da34a2da2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (shouldDeliverText && !hasMedia && isSilentReplyText(text, SILENT_REPLY_TOKEN)) { | ||
| return; |
There was a problem hiding this comment.
Close streaming card before suppressing silent final text
When renderMode is card with streaming enabled, onReplyStart opens a Feishu streaming card immediately; this new early return skips the normal final-text path that calls closeStreaming(), so a final NO_REPLY payload with no media exits before the streaming session is finalized with content. The later idle close runs with empty streamText, and FeishuStreamingSession.close does not update card content for empty text, leaving users with a lingering ⏳ Thinking... placeholder instead of a truly silent reply.
Useful? React with 👍 / 👎.
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this branch is a partial, conflicting Feishu silent-token fix, while current main already handles the shared reply-dispatcher normalization path and the remaining Feishu outbound hardening is tracked by the newer canonical PR at #56167. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Close this partial branch and finish any still-needed Feishu outbound guard and tests through #56167 or a narrow rebased replacement. Do we have a high-confidence way to reproduce the issue? Yes, at source level. The PR branch leaves Is this the best way to solve the issue? No. This PR is not the best way to solve the issue because it uses a non-exported root SDK import, only partially guards Feishu text exits, and is superseded by the newer outbound-focused PR with tests. Security review: Security review cleared: The diff only touches Feishu runtime code and imports existing SDK helpers; it does not change workflows, dependencies, scripts, generated artifacts, publishing, permissions, or secrets handling. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 839a5b1ec0d9. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Summary
SILENT_REPLY_TOKENfiltering that other channels (e.g. MSTeams) already implementNO_REPLY, the token was sent as real text to the Feishu API, triggering a⚠️ ✉️ Message failederrorisSilentReplyTextchecks in both the outbound adapter (sendText) and the reply dispatcher (deliver) to suppress the token before it reaches the Feishu APIChanges
extensions/feishu/src/outbound.ts: early-return withsuppressedresult when text isNO_REPLYextensions/feishu/src/reply-dispatcher.ts: skip delivery when text-only payload isNO_REPLYTest plan
NO_REPLYresponse — should no longer showMessage failedNO_REPLYtext still deliver the media🤖 Generated with Claude Code