[Bug] Fix Feishu p2p DM replies fail with SUBSCRIPTION_NOT_FOUND (fixes #83730)#94760
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 8:28 PM ET / 00:28 UTC. Summary PR surface: Source +10. Total +10 across 2 files. Reproducibility: yes. Current main is source-reproducible: it computes Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the separate Feishu delivery-target split after maintainer review and required checks, adding focused p2p/group/thread/streaming assertions if maintainers want lower future drift risk. Do we have a high-confidence way to reproduce the issue? Yes. Current main is source-reproducible: it computes Is this the best way to solve the issue? Yes. The separate AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dbb58341b51b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +10. Total +10 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
3e5470c to
2adaa1f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
83cdcb8 to
8b01486
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
The branch has been cleaned up to only contain the Feishu fix (2 files, +18/-8). All ClawSweeper findings have been addressed:
@vincentkoc could you please take a look? |
|
Live Feishu streaming test completed with additional permission (im:message.reactions:write_only): Key logs from the test:
Full gateway log available on request. @clawsweeper re-review |
|
PR body updated with streaming test evidence and screenshot. @clawsweeper re-review |
|
Friendly ping 🙏 This is a P1 user-facing bug — Feishu p2p DM replies are currently failing with SUBSCRIPTION_NOT_FOUND, which means affected users see silent message drops. The fix is minimal (2 files, +18/−8) and has been cleared by ClawSweeper (platinum). Would appreciate a look when you have a moment, even a quick sanity check on the routing logic would help unblock this. Thanks! |
Add sendTarget param to createFeishuReplyDispatcher that overrides the to: field for visible sends. Fix streaming card delivery target by stripping routing prefixes (user:, chat:) before the Feishu streaming API call. Route streaming card reply metadata through suppressed sendReplyToMessageId. Closes openclaw#83730
850f36e to
7126c25
Compare
|
Landed via rebase onto main.
Thanks @xydigit-zt! |

Summary
What problem does this PR solve?
Non-thread Feishu p2p (DM) replies are routed to
chat:<oc_xxx>(the raw p2p chat ID) instead ofuser:<open_id>, causingSUBSCRIPTION_NOT_FOUNDerrors when the bot attempts to reply.Why does this matter now?
Issue #83730 is a P1 regression introduced in OpenClaw 2026.5.12. After
skipReplyToInMessagessuppresses reply metadata for non-thread DMs, the visible reply becomes a top-level send to theoc_*chat target — which Feishu rejects.What is the intended outcome?
user:<open_id>instead ofchat:<oc_xxx>chatIdas beforeWhat is intentionally out of scope?
send-target.ts,targets.ts, orsend.tsWhat does success look like?
sendMessageFeishu,sendMediaFeishu, andsendStructuredCardFeishureceiveuser:ou_*as theto:target for non-thread p2p replies instead ofoc_*.Linked context
Closes #83730
Related clawtributors: #83764 (closed unmerged), #90636 (closed unmerged), #94761 (sibling PR, different approach)
Real behavior proof (required for external PRs)
user:<open_id>target instead of rawchatIdSUBSCRIPTION_NOT_FOUNDerrors in any log line.contact:contact.base:readonlyscope (stale, non-blocking). Streaming card creation returns HTTP 400 for a pre-existing permission reason, so streaming cards fall back to non-streaming card delivery. The fix does not address this unrelated card creation issue.createFeishuReplyDispatcherconstructs all visible sends withto: chatId(theoc_*p2p chat ID), which Feishu rejects withSUBSCRIPTION_NOT_FOUNDfor non-thread DM replies.Tests and validation
CI=true node node_modules/.bin/vitest run extensions/feishu/src/reply-dispatcher.test.ts— 82 passedCI=true node node_modules/.bin/vitest run extensions/feishu/src/bot.test.ts— 87 passedCI=true node node_modules/.bin/vitest run extensions/feishu/src/channel.test.ts extension/feishu/src/send.test.ts extension/feishu/src/send-target.test.ts— 84 passedRegression coverage: All existing Feishu reply-dispatcher and bot tests continue to pass. The fix is applied at the dispatcher parameter level. Streaming card delivery now also routes through
effectiveSendTargetwith suppressed reply metadata and normalized receive ID prefix.Risk checklist
Did user-visible behavior change? (
Yes)Yes — non-thread Feishu p2p DM replies now go to
user:<open_id>instead ofchat:<oc_xxx>, fixing the SUBSCRIPTION_NOT_FOUND error.Did config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)What is the highest-risk area? The
to:target change affects all visible sends (text, card, media, no-visible-reply fallback). Streaming start and conversation type detection are unchanged.How is that risk mitigated? The
sendTargetparameter defaults toundefined, falling back tochatId. Both dispatcher call sites inbot.tspass the pre-computedfeishuTovalue. Live Feishu p2p DM test confirms two successful dispatches.Current review state
What is the next action?
Maintainer / ClawSweeper review
What is still waiting on author, maintainer, CI, or external proof?
ClawSweeper re-review verdict. CI checks. Live Feishu p2p DM evidence (logs + screenshot) included above.