fix(feishu): prevent duplicate text send when sendMedia has no media URL#52192
fix(feishu): prevent duplicate text send when sendMedia has no media URL#52192kevinWangSheng wants to merge 1 commit into
Conversation
In the sendMedia handler, text was sent unconditionally at line 160 before checking for mediaUrl. When sendMedia is called with text but without a media URL, the text-only fallback at line 196 sends the same text again, resulting in duplicate messages in Feishu chats. Guard the pre-media text send with a mediaUrl check so the companion text message is only sent when media follows it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a duplicate-message bug in the Feishu The fix adds
Confidence Score: 5/5
Reviews (1): Last reviewed commit: "fix(feishu): prevent duplicate text send..." | Re-trigger Greptile |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection: call non-comment Feishu Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land a refreshed minimal Feishu guard equivalent to Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: call non-comment Feishu Is this the best way to solve the issue? Yes with changes: adding a Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0513b285ef95. |
|
Codex review: needs maintainer review before merge. What this changes: The PR changes the Feishu outbound Maintainer follow-up before merge: This is an active contributor implementation PR for a valid, narrow Feishu bug; the next action is maintainer review of the proposed guard and whether to require a regression test, not a replacement ClawSweeper fix PR. Review detailsBest possible solution: Land the minimal Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374. |
Summary
sendMediahandler, text is sent unconditionally at line 160 before checking formediaUrlsendMediais called with text but no media URL, the text-only fallback at line 196 sends the same text againRoot cause
The
sendMediafunction has three code paths:The pre-media text send at line 160 was not guarded by a
mediaUrlcheck, so it fires even when there is no media to follow.Fix
Add
&& mediaUrlto the condition at line 160, so the companion text message is only sent when media follows it. The text-only fallback at line 196 handles the no-media case correctly on its own.Test plan
pnpm test -- extensions/feishu/src/outbound)🤖 Generated with Claude Code