Repository navigation
fix(feishu): preserve accepted multi-part attachment delivery - #117196
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:54 PM ET / August 1, 2026, 03:54 UTC. ClawSweeper reviewWhat this changesThe PR makes Feishu consume an implicit first-reply target after the first accepted caption, media, or fallback delivery, while preserving explicit replies and native topic threading across multipart sends. Merge readinessThe patch appears correct and directly repairs a current Feishu delivery defect by reusing the established single-use reply-target owner. This PR remains open because it carries the protected Priority: P2 Review scores
Verification
How this fits togetherFeishu outbound delivery expands one agent response into captions, media uploads, degraded voice files, and fallback text. The shared reply-policy helper decides whether each individual platform send should reply to the original message or send normally. flowchart LR
Response[Agent response]
Plan[Caption and media plan]
ReplyPolicy[Shared reply policy]
FeishuOutbound[Feishu outbound delivery]
Upload[Media upload or fallback]
Platform[Feishu messages]
Response --> Plan
Plan --> ReplyPolicy
ReplyPolicy --> FeishuOutbound
FeishuOutbound --> Upload
FeishuOutbound --> Platform
Upload --> Platform
Decision needed
Why: The patch is a user-visible channel-routing change and the repository's protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +112. Total +122 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the canonical reply-fanout implementation after the designated Feishu owner confirms the final merge result preserves the tested caption, rejected-upload, degraded-voice, explicit-reply, and native-topic behaviors. Do we have a high-confidence way to reproduce the issue? Yes, from source and submitted regression evidence: current main reuses one resolved implicit reply target for multipart direct-media sends, while the branch tests the caption, rejected-upload, degraded-voice, explicit, and topic-root sequences that expose the duplication. Is this the best way to solve the issue? Yes. Reusing the existing public AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3374f78ad8e9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '441d6ab254df14fb6939a8a261f474904ff9c500': (388 commits) fix(qqbot): ignore blank app id fallbacks (openclaw#109460) fix(feishu): consume implicit reply targets across media delivery (openclaw#117196) fix(exec): preserve approved command output when sessions resume (openclaw#117177) fix(qa): use public subagent fanout evidence (openclaw#116832) fix(googlechat): cancel unread auth response bodies before release (openclaw#115873) fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666) fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969) fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392) fix(mistral): keep terminal error branch lint-clean fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110) refactor(i18n): remove unused Apple contradiction report (openclaw#117182) fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167) perf: count large histories before Gateway prewarm (openclaw#117118) fix(signal): restore provider-safe original attachment filenames (openclaw#115107) refactor(channels): unify setup ownership across bundled channels (openclaw#117188) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) ...
…enclaw#117196) Co-authored-by: Peter Steinberger <[email protected]>
* commit 'ae4e662145b6aa162777cdb1c011b3f04ddd230d': (388 commits) fix(qqbot): ignore blank app id fallbacks (openclaw#109460) fix(feishu): consume implicit reply targets across media delivery (openclaw#117196) fix(exec): preserve approved command output when sessions resume (openclaw#117177) fix(qa): use public subagent fanout evidence (openclaw#116832) fix(googlechat): cancel unread auth response bodies before release (openclaw#115873) fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666) fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969) fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392) fix(mistral): keep terminal error branch lint-clean fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110) refactor(i18n): remove unused Apple contradiction report (openclaw#117182) fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167) perf: count large histories before Gateway prewarm (openclaw#117118) fix(signal): restore provider-safe original attachment filenames (openclaw#115107) refactor(channels): unify setup ownership across bundled channels (openclaw#117188) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) ...
What problem does this solve?
Feishu direct attachment delivery sends several separate platform messages when a payload has a caption, an upload fallback, or a voice attachment that degrades to a normal file. Its private
sendMediaowner reused one implicit first-only reply ID for every send, so users received multiple unwanted replies to the same quoted message.This is one root cause with three independently reproduced user-visible failure paths:
The frozen source baseline is
fdcb321bfaaadb5a1e7d123b6be7a934980f8b12; earlier Feishu PR #117023 is already present in this baseline and none of its fixed roots are counted again.Why is this the right fix?
The existing shared
createReplyToFanoutcontract insrc/infra/outbound/reply-policy.tsalready owns implicit reply consumption, and neighboring Feishu card, TTS, and presentation fallback paths use it. The direct-media owner now uses that same canonical decision for every actual send. An upload rejected before dispatch retains its still-unconsumed reply target; explicit reply targets and native topic roots remain intentionally sticky. Accepted partial deliveries still propagate without replay.No public configuration, authentication, plugin SDK, protocol, persistence, migration, dependency declaration, or external account behavior changes. Production delta: +23/-13, net +10 lines, justified by applying the existing lifecycle owner across captions, media, fallback, degraded voice, and explicit-thread siblings.
Frozen-source RED regression proof
With production source exactly at
fdcb321bfaaadb5a1e7d123b6be7a934980f8b12:Exact-head focused regression proof
Candidate head:
385a4ad86dcf37102e23c2d9313a4be17763a2ed; tree:7af5bafa8f5d9c67ef8517f5d4e0becf00a13580.The newer canonical main
982add961804097f5a6b0b94255c5c855e8ad863leaves the complete Feishu subtree, canonical reply fanout/receipt owners, extension type/lint configurations, pinned lockfile, and Lark dependency unchanged. Its generic account-setup simplification and profile install-identity changes do not modify Feishu outbound delivery or account config shapes. A read-onlygit merge-tree --write-treesucceeds without conflicts and yields synthetic merge tree3e7521a0cda3327517bd430cc5263b87525bedee; the reviewed candidate identity remains unchanged.Regression controls explicitly prove a rejected first upload retains its unused target, explicitly selected replies stay sticky, and every native topic reply keeps
reply_in_thread: true.Actual installed Lark SDK + real local HTTP production proof
An external, source-unchanged probe invokes actual production
feishuOutbound.sendMedia, the actual OpenClawloadWebMedia, and the actual installed@larksuiteoapi/node-sdkagainst a real local HTTP server. The genuine SDK exchanges its tenant token and performs real image/file uploads plus message reply/create requests. No SDK method or provider result is mocked. Placeholder identities are redacted.{"scenario":"implicit caption then attachment","sdk":"@larksuiteoapi/node-sdk","transport":"real localhost HTTP","events":[{"path":"/open-apis/im/v1/messages/om_redacted_parent/reply","messageType":"post"},{"path":"/open-apis/im/v1/images"},{"path":"/open-apis/im/v1/messages","messageType":"image"}]} {"scenario":"implicit caption then rejected attachment fallback","sdk":"@larksuiteoapi/node-sdk","transport":"real localhost HTTP","events":[{"path":"/open-apis/im/v1/messages/om_redacted_parent/reply","messageType":"post"},{"path":"/open-apis/im/v1/images","rejected":true},{"path":"/open-apis/im/v1/messages","messageType":"post"}]} {"scenario":"implicit degraded voice then visible text","sdk":"@larksuiteoapi/node-sdk","transport":"real localhost HTTP","events":[{"path":"/open-apis/im/v1/files"},{"path":"/open-apis/im/v1/messages/om_redacted_parent/reply","messageType":"file"},{"path":"/open-apis/im/v1/messages","messageType":"post"}]} {"scenario":"explicit reply remains sticky","sdk":"@larksuiteoapi/node-sdk","transport":"real localhost HTTP","events":[{"path":"/open-apis/im/v1/messages/om_redacted_parent/reply","messageType":"post"},{"path":"/open-apis/im/v1/images"},{"path":"/open-apis/im/v1/messages/om_redacted_parent/reply","messageType":"image"}]} {"scenario":"explicit native topic remains sticky","sdk":"@larksuiteoapi/node-sdk","transport":"real localhost HTTP","events":[{"path":"/open-apis/im/v1/messages/om_redacted_topic/reply","messageType":"post","replyInThread":true},{"path":"/open-apis/im/v1/images"},{"path":"/open-apis/im/v1/messages/om_redacted_topic/reply","messageType":"image","replyInThread":true}]}All five actual network scenarios passed. This is controlled local-provider proof, not a hosted Feishu account claim; no real credentials were used.
Independent review and remote exact-head validation
Three independent agents reviewed complete Feishu owners, canonical reply lifecycle, all sibling delivery paths, dependency contracts, and exact immutable head: P0/P1/P2/P3 clean. The external reviewer independently reran all five real-SDK/local-HTTP scenarios.
A genuine full-branch Codex autoreview explicitly used
--max-priority P3, modelgpt-5.6-sol, high reasoning, and a real clean TruffleHog preflight:{"findings":[],"overall_correctness":"patch is correct","overall_confidence":0.93}One dedicated Blacksmith Testbox imported and checked out the exact commit/tree, refreshed pinned workspace dependencies, and successfully ran exact-head type-aware Feishu lint, extension test types, all nine relevant owner suites, and the actual installed-SDK HTTP probe:
The supporting Testbox workflow runs from
mainand may report cancellation after external lease cleanup; it is not described as hosted exact-head PR CI. Exact candidate identity is established by the detached Git commit/tree printed above before all successful remote commands.