fix(feishu): fall back to direct send when reply target is withdrawn#27614
fix(feishu): fall back to direct send when reply target is withdrawn#27614justinhuangai wants to merge 1 commit into
Conversation
Greptile SummaryAdded graceful fallback when Feishu message reply targets are withdrawn or deleted (error codes 230011 and 231003). The bot now sends the reply as a new direct message instead of silently dropping it.
Confidence Score: 5/5
Last reviewed commit: 9f3d329 |
|
I checked failing jobs and there is a deterministic protocol-generation blocker:
So this is currently not only a flaky Windows issue; protocol artifacts are out of sync in this branch. Actionable fix:
After that, we can reassess remaining Windows-shard failures separately. |
9f3d329 to
5b7fe99
Compare
|
Thanks for catching that! Rebased onto latest main (5b7fe99) — the protocol drift was from upstream #27589 ( |
a366877 to
1d291a5
Compare
When a user withdraws or deletes a message after the bot has started composing a reply, the Feishu API returns error 230011 (withdrawn) or 231003 (not found). Previously this caused a hard failure that dropped the reply entirely. Add `isFeishuMessageGoneError()` helper to detect these codes and apply a fallback-to-direct-send pattern in all four reply paths: `sendMessageFeishu`, `sendCardFeishu`, `sendImageFeishu`, and `sendFileFeishu`. Closes openclaw#27103 Co-Authored-By: Claude Opus 4.6 <[email protected]>
1d291a5 to
f5477c7
Compare
|
Closing — the reply fallback for withdrawn/deleted messages was implemented upstream in 2a252a1 ( |
Problem
When a Feishu user withdraws (撤回) a message while the bot is composing a reply,
im.message.replyreturns error 230011 or 231003. The reply is silently dropped — the user sees nothing.This affects all message types: text, cards, images, and files.
Root Cause
All four send functions (
sendMessageFeishu,sendCardFeishu,sendImageFeishu,sendFileFeishu) callim.message.replyand immediately assert success. There's no handling for the "target message gone" case:Fix
Added
isFeishuMessageGoneError()to detect codes 230011 (withdrawn) and 231003 (not found). When a reply target is gone, fall back toim.message.create(direct send) instead of throwing:Applied consistently across all four send functions. Non-gone errors still throw as before.
Tests
35 tests across 3 files:
send-result.test.ts—isFeishuMessageGoneErrorfor both codes, success, other errors, undefinedsend.test.ts— text and card fallback (230011, 231003), non-gone error propagation, normal reply, direct sendmedia.test.ts— image and file fallback,msg_typepreservation for media vs fileFixes #27103
Related #27525 (addresses typing indicator spam — a separate symptom from the same issue)