fix(feishu): reply inside thread for P2P direct messages#38808
fix(feishu): reply inside thread for P2P direct messages#38808LiaoyuanNing wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a Feishu bot regression where replies to P2P (direct message) thread messages were posted outside the thread container. The fix introduces a The Confidence Score: 5/5
Last reviewed commit: 1bd3555 |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Keep this PR open. Current main still routes Feishu P2P direct-thread messages through the non-thread DM path, while the paired open bug #38806 remains unresolved and this PR is the active narrow implementation candidate. The provided PR diff is scoped to Feishu bot routing, tests, and changelog, with no visible security-sensitive or supply-chain changes. Best possible solution: Review and land this narrow Feishu plugin fix, or apply the same behavior on main: detect direct messages with What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ef58307f843e. |
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #38808 |
1bd3555 to
84d0830
Compare
When a user sends a message inside a Feishu thread (话题) in a P2P chat, the bot's reply was incorrectly sent outside the thread as a standalone message. This was caused by PR openclaw#33789 which fixed group reply targeting (openclaw#32980) but inadvertently broke P2P thread replies by gating all thread-aware logic behind isGroup checks. The fix distinguishes between two P2P scenarios based on the Feishu API contract (thread_id present = thread message, root_id only = quote reply): - P2P thread messages (thread_id present): reply to root_id with reply_in_thread=true so the response stays in the thread. - P2P plain replies (root_id only, no thread_id): reply to the triggering message as before. Group chat behavior is completely unchanged — the new condition (directThreadMessage) requires isDirect=true, which is always false for groups. Changes: - replyInThread: true for P2P thread messages (enables reply_in_thread API flag) - replyTargetMessageId: use root_id for P2P thread messages - threadReply: true for P2P thread messages (drives effectiveReplyInThread in dispatcher) - skipReplyToInMessages: false for P2P thread messages (so send layer uses im.message.reply instead of im.message.create) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
84d0830 to
e0a0ba6
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #38808 |
Summary
thread_idpresent) and plain quote replies (root_idonly) per the Feishu API contractisDirect=trueFixes #38806
Changes
Four targeted changes in
extensions/feishu/src/bot.ts, all gated bydirectThreadMessage = isDirect && Boolean(ctx.threadId):replyInThreadfalsetruefalse(unchanged)replyTargetMessageIdctx.messageIdctx.rootIdctx.messageId(unchanged)threadReplyfalsetruefalse(unchanged)skipReplyToInMessagestruefalsetrue(unchanged)Test plan
replyInThread=truereplyInThread=false