fix(feishu): reply inside P2P threads instead of main chat#38814
fix(feishu): reply inside P2P threads instead of main chat#38814xinhuagu wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a regression (#33789) where bot replies inside P2P (direct message) threads landed in the main chat instead of staying in the thread. Three coordinated changes in
The fix is correct and well-scoped; existing group-chat behaviour is unaffected. One minor note: the P2P-thread condition is computed twice under different variable names ( Confidence Score: 4/5
Last reviewed commit: 90331bf |
86204bb to
3922ed1
Compare
When a user sends a message inside a thread in a P2P (direct message) chat, the bot replies outside the thread as a standalone message. This was introduced by openclaw#33789, which gated all thread-aware reply logic behind isGroup checks. Three places need to handle P2P threads: 1. replyInThread was forced false for P2P — now true when thread_id is present (indicating a thread message per Feishu API docs) 2. replyTargetMessageId ignored root_id for P2P — now uses root_id for P2P threads so the reply targets the thread root 3. skipReplyToInMessages was always true for P2P — now false for P2P threads so the send layer uses im.message.reply (thread reply) instead of im.message.create (new standalone message) Closes openclaw#38806
3922ed1 to
f270cda
Compare
|
Closing in favor of #38808 which landed first with the same approach. |
Summary
When a user sends a message inside a thread in a P2P (direct message) chat, the bot replies outside the thread as a standalone message.
This regression was introduced by #33789, which fixed group reply targeting (#32980) but inadvertently broke P2P thread replies by gating all thread-aware logic behind
isGroupchecks.Changes
Three places in
extensions/feishu/src/bot.tsnow handle P2P threads:replyInThread— was forcedfalsefor P2P; nowtruewhenthread_idis present (indicating a thread message per Feishu API docs)replyTargetMessageId— ignoredroot_idfor P2P; now usesroot_idfor P2P threads so the reply targets the thread rootskipReplyToInMessages— was alwaystruefor P2P; nowfalsefor P2P threads so the send layer usesim.message.replyinstead ofim.message.createThe distinction between
thread_id(thread message) androot_idalone (quote reply) is preserved — only messages withthread_idtrigger thread-aware behavior in P2P.Testing
isDirect && Boolean(ctx.threadId))Closes #38806