Repository navigation
fix(feishu): promote send attachment aliases instead of silent drop - #125664
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 11:19 AM ET / 15:19 UTC. ClawSweeper reviewWhat this changesThe PR makes Feishu resolve supported attachment aliases on direct sends, reject unsupported or ambiguous media requests visibly, and preserve partial-delivery receipts when upload fails after a caption is sent. Merge readinessKeep open: current main still silently sends Feishu text when a direct message action supplies attachment aliases instead of Priority: P1 Review scores
Verification
How this fits togetherGateway message actions dispatch channel-specific send parameters to the Feishu plugin. The plugin turns a supported local media path into a Feishu upload and returns a delivery receipt or an actionable error to the agent. flowchart LR
A[Agent message action] --> B[Gateway send dispatch]
B --> C[Feishu channel plugin]
C --> D[Resolve media aliases]
D --> E{One supported file?}
E -->|Yes| F[Feishu upload and receipt]
E -->|No| G[Actionable send error]
F --> H[Gateway response]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +452, Tests +927. Total +1379 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the Feishu-local validation and receipt handling as the canonical direct-send behavior, with supported aliases continuing to resolve and unsupported intent failing visibly. Do we have a high-confidence way to reproduce the issue? Yes—current-main source provides a high-confidence direct path: a message action reaches the Feishu adapter with attachment aliases but the adapter reads only Is this the best way to solve the issue? Yes—the channel-local repair follows the transport-specific single-media policy and existing sibling precedent without imposing Feishu rules on every channel. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 70d7fb5771f9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (28 earlier review cycles; latest 8 shown)
|
2bdb756 to
79bc883
Compare
79bc883 to
30bfd86
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
30bfd86 to
9f245a6
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9f245a6 to
a636768
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a636768 to
5ebb01d
Compare
5ebb01d to
e39efb1
Compare
bf96376 to
cc6acc0
Compare
cc6acc0 to
9221e7d
Compare
9221e7d to
df3de8c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
CI is currently red on this PR (and on other PRs such as #128663) due to a Failure: Root cause (on This PR does not touch Once |
A direct Gateway message.action send may arrive with attachment aliases (path/filePath/fileUrl/image/mediaUrl/mediaUrls/attachments[]) instead of the canonical media field. The Feishu send handler only read params.media, so any alias was silently dropped and the send returned ok:true on the text-only branch, misleading the agent about delivery (openclaw#112244). Add resolveFeishuSendAttachmentMedia (mirrors the Mattermost send-attachment resolver) to collect every alias into one canonical mediaUrl, reject unsupported buffer/base64 payloads, and reject multiple attachments (Feishu delivers one media item per message). thread-reply keeps its text-only path. Related to openclaw#112244
|
Maintainer verification on exact head 87d227b. No code changes were needed on top of the contributor commit. The Feishu owner boundary now promotes supported attachment aliases, rejects unsupported or malformed attachment intent visibly, preserves the established document-comment link fallback, and carries caption receipts through Gateway partial-delivery errors. ClawSweeper items:
Local gates:
Telegram default-turn probe: pass. Doctor passed, the real-user DM received OPENCLAW_E2E_OK, and the mock provider recorded three requests. Evidence: proof/pr-125664/telegram/summary.json. CI: openclaw/ci-gate passed on run 32743402675 for this exact head. The unrelated owner-sweep failures are not part of this PR. |
Closes #112244
What Problem This Solves
When an agent sends a Feishu message with an attachment via a path/URL-style parameter (e.g.
filePath,mediaUrl,image), the attachment was silently dropped and the send returnedok:trueon the text-only branch — the agent believed the attachment was delivered when it was not. This promotes every attachment alias to a single canonical media URL, rejects attachment intent Feishu cannot represent (including present-but-malformed media source values), and propagates media-upload failures to the action caller, so the send either delivers the attachment or fails visibly.params.media. A direct Gatewaymessage.action sendmay arrive with attachment aliases (path/filePath/fileUrl/image/mediaUrl/mediaUrls/attachments[]) instead of the canonicalmediafield; those aliases were never promoted, somediawas empty, the handler took its text-only success branch, and the attachment was lost while the action reported success. The Gateway action contract resolves both camelCase and snake_case spellings (mediaUrl/media_url,filePath/file_path) before a message action reaches a channel, andbuffer/base64may arrive nested insideattachments[]entries rather than only at the top level. A second silent-success class existed downstream: when a promoted alias reachedfeishuOutbound.sendMediabut the upload failed, the outbound layer caught the error and fell back to a text send, returningok:truewhile the attachment never arrived.resolveFeishuSendAttachmentMediain the Feishu channel (mirrors the existing MattermostresolveMattermostSendAttachmentMediaresolver) that collects every alias into one canonicalmediaUrl, honors both camelCase and snake_case spellings (somedia_urls/file_path/file_urlare no longer invisible), accepts a single string in place of amediaUrlsarray, scans eachattachments[]entry for unsupportedbuffer/base64payloads (not only the top level), rejects unsupportedbuffer/base64payloads, rejects thefileattachment-intent parameter (the linked issue's literal reproduction{ message, file: "/path/to/script.py" }—fileis deliberately excluded from the sharedBASE_ACTION_MEDIA_SOURCE_PARAM_KEYScontract because its meaning is ambiguous, so it is rejected as an unsupported attachment intent rather than silently swallowed on the text-only success branch), rejects multiple attachments (Feishu delivers one media item per message), and rejects present-but-malformed media source values such asmedia: {}ormediaUrls: [{}](a present non-string value is an attachment-intent signal the resolver cannot promote to a mediaUrl; treating it as absent would recreate the silent text-onlyok:truesuccess this PR removes). For the downstream class,feishuOutbound.sendMediaaccepts an optionalpropagateMediaUploadFailureflag; the directsendaction sets it so a media-upload failure is re-thrown to the caller as a controlled failure instead of being converted to a fallback text success.extensions/feishu/src/channel.ts(newresolveFeishuSendAttachmentMedia+collectFeishuSendAttachmentMedia+toFeishuSnakeCaseKey/readFeishuParamfor camelCase-or-snake_case lookup +readFeishuParamPresenceto distinguish absent / present / malformed values +hasFeishuUnsupportedIntentValueso a present NON-string value for the unsupportedfile/buffer/base64intent keys is rejected instead of silently skipped via string coercion; send action now calls it instead ofreadFeishuMediaParam, and passespropagateMediaUploadFailure: truetosendMediascoped toctx.action === "send"only so thread-reply keeps its fallback-text behavior);extensions/feishu/src/outbound.ts(new exportedFeishuOutboundSendMediatype;feishuOutbound.sendMediaacceptspropagateMediaUploadFailureand, when set, re-throws a wrappedFeishu send could not deliver the requested media attachmenterror on upload failure instead of falling back to text; when the caption was already delivered before the upload failed, the re-thrown error is the repository's existingcreateChannelPartialDeliveryErrorcarrying the caption's message id, so the caller knows the text is visible and does not retry/duplicate it);src/gateway/server-methods/send.ts(createGatewayInflightUnavailableFailuredetectsisChannelPartialDeliveryErrorand preserves itsdeliveryResultonerror.details.partialDeliverywithretryable:false, so the caption receipt crosses the Gatewaymessage.actionboundary instead of being dropped byString(err)— one change covering all three call sites that route through this failure helper);extensions/feishu/src/channel.test.ts(regression tests for camelCase alias promotion, snake_case alias promotion,media_urlsarray, single-stringmediaUrls, top-level and nestedbuffer/base64rejection, mixed supported+unsupported rejection, top-level and nestedfileattachment-intent rejection, blank-payload ignore, blank-fileignore, multi-attachment rejection, malformed media source rejection for top-level/nestedmedia: {},mediaUrls: [{}], and non-string scalar values with blank-string-still-passes coverage, malformed non-string unsupported-intent rejection for top-level/nestedfile: {}/buffer: {}/base64: {}/file: 42, thepropagateMediaUploadFailure: trueassertion scoped to the send action's sendMedia call, and a thread-reply regression asserting the flag is absent and fallback is retained);extensions/feishu/src/outbound.test.ts(regression tests thatpropagateMediaUploadFailurere-throws on upload failure without a fallback text send, and that the default fallback behavior is unchanged when the flag is absent, plus a caption-preservation case asserting the re-thrown error is aChannelPartialDeliveryErrorcarrying the caption message id withvisibleReplySent:true, and a no-caption case asserting a plain wholly-failed error);src/gateway/server-methods/send.test.ts(regression tests thatmessage.actionreturns the caption receipt aserror.details.partialDeliverywithretryable:falsewhen dispatch throws aChannelPartialDeliveryError, and that a plain dispatch error staysretryable:truewith no partial-delivery details).hydrateAttachmentParamsForAction), the outbound runner path, thread-reply behavior (still text-only viareadFeishuMediaParam), and every other channel. The closed PR fix(gateway): resolve canonical media params on message.action dispatch #112490 attempted a shared-layer normalization helper that no longer exists after themessage.actiondispatch refactor; this PR targets the current main directly at the Feishu boundary.Why This Change Was Made
The fix is placed at the Feishu channel boundary rather than the shared Gateway hydration layer because the only channel confirmed to silently drop attachments and return success is Feishu: Mattermost already normalizes all aliases in its own
resolveMattermostSendAttachmentMedia, iMessage expects attachments pre-hydrated tobufferand fails loudly on a raw path, and qa-channel/clickclack throw whenmediaUrlis absent. A shared-layer fix would require proving it does not perturb those channels for a benefit that is currently Feishu-only; the channel-boundary fix localizes the blast radius and reuses a pattern maintainers have already accepted (Mattermost).hydrateAttachmentParamsForAction'ssendbranch (originally considered). Rejected because it would need a proof of non-interference with Mattermost/iMessage/qa-channel and could not enforce Feishu's single-attachment contract without leaking channel-specific policy upward.thread-replystill rejects media via the existing text-only path (no change). Sandbox path resolution is not added at the channel layer (Mattermost does not do this either); the resolvedmediaUrlis passed tofeishuOutbound.sendMedia, which already enforcesmediaLocalRoots/mediaAccesson load.User Impact
After this change, asking an agent to send a Feishu message with a file path, URL, or image attachment either delivers the attachment or returns a clear error — it no longer reports success while silently sending text only. Agents that acted on the false
ok:true(e.g. believing a file was shared) will now see an explicit failure for unsupported payloads. No configuration changes; other channels are unaffected.Evidence
Real Feishu delivery proof (final head
87d227b33f2, rebased onto latest main + exact-head proof refresh)Refreshed redacted proof from the current PR head
87d227b33f2d8866b2cf3e09ccab7ad4e55ee48f. This head is the fifteenth-review headcc6acc02bc8rebased onto the latestorigin/main(the prior head9221e7dhad been trimmed down to alias-promotion-only and silently dropped the malformed-rejection guard and the upload-failure propagation that earlier review rounds required, which reopened two P1 false-success paths; this head restores the fullcc6acc02bc8implementation —readFeishuParamPresencemalformed detection,propagateMediaUploadFailure, theFEISHU_PROPAGATE_MEDIA_UPLOAD_FAILURE_MARKER, and theoutbound.tschanges — on top of current main), plus the seventeenth-review P1 fix (preserve a delivered caption as partial delivery when the media upload fails), the eighteenth-review P1 fix (return that caption receipt through the Gatewaymessage.actionboundary instead of dropping it viaString(err)), and the nineteenth-review P1 fix (reject present non-string values for the unsupportedfile/buffer/base64attachment-intent keys instead of silently skipping them and falling through to a text-onlyok:true). The twentieth-review rebase onto currentorigin/mainresolved the one merge conflict increateGatewayInflightUnavailableFailureby composing both Gateway error outcomes on one boundary: a partial-delivery error still yieldserror.details.partialDelivery+retryable:false, and a recovery-ownedOutboundDeliveryError(queue-owned retry) still yieldserror.details.code = OUTBOUND_DELIVERY_QUEUED, so the queued-delivery contract from main is preserved alongside the partial-delivery receipt (the two are mutually exclusive — partial delivery takes priority because an already-visible caption must not be retried). The twenty-first-review fixes address two further P1 findings: (1) the nestedattachments[].imagealias is now collected just like the top-levelimagealias (it was previously omitted from the nested attachment key list, soattachments: [{ image: "/tmp/a.png" }]silently fell through to text-onlyok:true); (2)retryableis now set tofalseonly on a partial-delivery receipt and omitted otherwise, restoring main's non-retryable shape for ordinary and queued failures (the priorretryable: !partialDeliveryinadvertently marked every non-partial failure asretryable: true, which Gateway clients treat as permission to replay an indeterminate send). The real-Feishu transcript below (scenarios 5/9/10) was captured against the immediately-prior headdf3de8c96cband is retained because the seventeenth-, eighteenth-, and nineteenth-review changes do not alter any of those three code paths — scenario 5 is a successfulfilePathdelivery (no upload failure), scenario 9 throws in the resolver before any caption send, and scenario 10 targets a document comment that never uploads — so their recordedmessageIds remain valid on87d227b33f2; the caption-preservation behavior at the outbound boundary is covered by scenario 11 (real Feishu), the Gateway-boundary serialization of that receipt intoerror.details.partialDelivery+retryable:falseis covered by the paired regression test insrc/gateway/server-methods/send.test.ts(pre-fix fail / post-fix pass), and the malformed non-string attachment-intent rejection is covered by scenario 12 (real Feishu, this head) below. Covers the unchanged direct-send attachment delivery (scenario 5, run so the transcript names the current head lineage), the twelfth-review P1 fix (scenario 9: malformed attachment containers and non-record entries now rejected before the text branch), the fifteenth-review P1 fix (scenario 10: a document-comment target with the propagation marker set now renders the media URL as a visible comment link and returns a success receipt instead of throwing), the eighteenth-review P1 fix (scenario 11: a directsendwith a delivered caption and a controlled media failure now surfaces the real caption message id as a partial-delivery receipt instead of a receipt-less error), and the nineteenth-review P1 fix (scenario 12: present non-stringfile/buffer/base64attachment-intent values now rejected before the text branch instead of silently skipped). Scenarios 5, 9, 11, and 12 are driven throughfeishuPlugin.actions.handleAction(the Gateway send dispatch path) with a real Feishu app (cli_aac95aea7f219cff, bot "SunnyApp"), a real media file on disk, and a real chat target (oc_8f9272069c4a73e6ab8fef16fa45a0ba); scenario 10 drivesfeishuOutbound.sendMediadirectly against a real document-comment target (comment:docx:Ngd0ddcOnolCysxkexBcKjhNnH8:7675663856085028021, the same comment resolved in the tenth-round proof). The outboundsendMediapath is NOT mocked. App credentials were supplied via a 0600-perm temp file read by the proof script (never on a command line or in shell history) and removed after the run; the reply added by scenario 10 was deleted via the FeishuDELETE /drive/v1/files/{file_token}/comments/{comment_id}/replies/{reply_id}API after the run; secrets are not present in any output below.Real Feishu delivery proof (prior head
91b014dd6216, fourth-review P1 fix)Refreshed redacted proof from the current PR head, covering both the unchanged direct-send attachment delivery and the fourth-review P1 fix (document-comment fallback). Driven through
feishuPlugin.actions.handleAction(the Gateway send dispatch path) andfeishuOutbound.sendPayloadwith a real Feishu app (cli_aac95aea7f219cff, bot "SunnyApp"), a real media file on disk, and real chat + document-comment targets. The outboundsendMedia/sendPayloadpaths are NOT mocked. App credentials were supplied via a 0600-perm temp file read by the proof script (never on a command line or in shell history) and removed after the run; secrets are not present in any output below.Targets:
oc_8f9272069c4a73e6ab8fef16fa45a0ba(group "Sunny")comment:docx:Ngd0ddcOnolCysxkexBcKjhNnH8:7675663856085028021— a real Feishu docx wiki node (EsnCworwwiMXOmkeB6mc73upnkH) resolved toobj_token Ngd0ddcOnolCysxkexBcKjhNnH8viawiki/v2/spaces/get_node, with a real document comment the bot has read/comment permission on.Real Feishu delivery proof (prior head
80fdad787687, retained for before/after contrast)The proof below was captured against an earlier head and is retained as the before/after contrast for the round-3/round-9 findings; it is superseded by the final-head proof above for the current review.
Driven through
feishuPlugin.actions.handleAction— the same handler the Gateway dispatchesmessage.action sendthrough — with a real Feishu app (cli_aac95aea7f219cff, bot "SunnyApp"), a real media file on disk, and a real Feishu chat target (oc_8f9272069c4a73e6ab8fef16fa45a0ba). The outboundsendMediapath is NOT mocked; it resolves the alias, loads the file, uploads it to Feishu, and delivers a real message. Scenario 5 drives a supportedfilePathalias through the full final-head adapter path (handleAction → resolveFeishuSendAttachmentMedia → feishuOutbound.sendMedia → sendMediaFeishu → loadWebMedia → uploadFileFeishu → sendFileFeishu) and records a realkind:"media"delivery; scenario 7 drives a nestedattachments[].mediaUrlslist through the same full path (the round-9 P1 fix), proving the nested list is now collected instead of silently dropped. App credentials were supplied via a 0600-perm temp file read by the proof script (never on a command line or in shell history) and removed after the run; secrets are not present in any output below.Unit-test behavior matrix (Feishu
sendaction,extensions/feishu/src/channel.test.ts)Real runtime unit-test proof (vitest run via
node scripts/run-vitest.mjs, on the current PR head87d227b33f2):Post-fix (this PR,
87d227b33f2):Pre-fix (channel.ts reverted to the second-review head
30bfd86bf89— the version ClawSweeper rated 2/6 — tests kept, malformed-source tests added):The 7 malformed tests fail on the second-review head because a present non-string value (e.g.
media: {}) was read as absent byreadFeishuStringParam, produced nomediaUrl, fell through to the text sender, and returnedok:true— confirming the third-review P1 finding ("Reject malformed declared media sources"). The 3 blank tests pass pre-fix because a blank string is a string and therefore not malformed. After the fix, all 10 pass alongside the full 136-test shard.Gateway
message.actionboundary — caption receipt serialization (eighteenth-review P1 fix,src/gateway/server-methods/send.test.ts):Pre-fix (send.ts reverted to the seventeenth-round head
1331ae3f5cb— before the Gateway boundary preserveddeliveryResult; the new send.test.ts cases kept):The pre-fix failure confirms the eighteenth-review P1: the seventeenth-round outbound fix throws
ChannelPartialDeliveryErrorwith the caption receipt, but the Gatewaymessage.actionboundary (createGatewayInflightUnavailableFailure) serialized it viaString(err)and droppeddeliveryResult, so the agent could not know the caption arrived and might retry it (duplicating visible text). Post-fix the boundary detectsisChannelPartialDeliveryError, preservesdeliveryResultonerror.details.partialDelivery, and setsretryable:falseso the agent does not resend an already-visible caption; a plain error staysretryable:truewith no partial-delivery details (unchanged behavior). The real-Feishu scenario 11 above proves the outbound side of this receipt (a real caption message id is preserved); this regression proves the Gateway side of the same receipt.Malformed non-string attachment-intent rejection (nineteenth-review P1 fix,
extensions/feishu/src/channel.test.ts):Pre-fix (channel.ts reverted to the eighteenth-round head
aa0f7358293— before the resolver rejected non-string unsupported-intent values; the new channel.test.ts cases kept):The pre-fix failures confirm the nineteenth-review P1: the unsupported-intent keys (
file/buffer/base64) were read via string coercion (readFeishuStringParam), which returns undefined for objects, soBoolean(...)was false, leaving no candidate and falling through to a text-onlyok:truereceipt — the exact silent-drop this PR removes. Post-fix the resolver detects a present non-string value viahasFeishuUnsupportedIntentValueand rejects it before the text branch, at both the top level and insideattachments[]; a blank string stays ignored (unchanged). The real-Feishu scenario 12 above proves this on the live handleAction dispatch path.npx oxfmt --check extensions/feishu/src/channel.ts extensions/feishu/src/channel.test.ts: all matched files use the correct format.npx oxlint -c .oxlintrc.json extensions/feishu/src/channel.ts extensions/feishu/src/channel.test.ts: 0 warnings, 0 errors.feishuPlugin.actions.handleActiondirectly rather than through a running Gateway process, so the in-process Feishu plugin runtime (media loader chain) is not initialized; scenario 1/3 reachsendMediaFeishuwhich raisesPlatformMessageNotDispatchedError, and (post-fix) the direct send action now propagates that as a controlled failure instead of returning a text-onlyok:true. The alias-to-mediaUrl promotion, entry into the real sendMedia path, and the propagate-on-failure behavior are proven by scenarios 1/3/5; the real Feishu file upload + file-message delivery is proven independently by scenario 4 (same account, same chat, sameim/v1/files+im/v1/messages(msg_type=file)calls thatsendMediaFeishumakes). Other channels were intentionally not changed and not re-tested.AI Assistance
AI-assisted: Yes
Tools: Claude (glm-5.2 via local bridge)
Prompts / session excerpts:
/open-source-pr issue 112244workflow. Root-cause analysis compared the Feishu send handler against the MattermostresolveMattermostSendAttachmentMediaresolver and audited every channel (Feishu/Mattermost/iMessage/qa-channel/clickclack/zalo/sms) to confirm the silent-drop was Feishu-only and the fix belonged at the Feishu boundary. A later/open-source-pr auditmin-fix pass caught a trimmed head that had re-opened two false-success paths; the fix was restored to the full implementation. Full per-iteration session log available on request — the review history is also captured in the ClawSweeper review comment and commit history on this PR.Confirmed understanding of code changes: Yes.
resolveFeishuSendAttachmentMediacollects every attachment alias (media/mediaUrl/path/filePath/fileUrl/image/mediaUrls/attachments[]entries, camelCase + snake_case) into one canonicalmediaUrl, dedups, enforces single-attachment, and rejects unsupported payloads (buffer/base64), thefileintent key, and present-but-malformed values — all before the text branch. The unsupported-intent keys (file/buffer/base64) are read viahasFeishuUnsupportedIntentValue, which treats a present non-string value (e.g.file: {}) as a malformed intent to reject, not as absent via string coercion. Thesendaction setspropagateMediaUploadFailureso a real upload failure re-throws instead of degrading to a textok:true; when the caption was already delivered before the upload failed, the outbound boundary re-throwscreateChannelPartialDeliveryErrorcarrying the caption's message id (so the caller knows the text is visible and does not retry/duplicate it), and a send with no delivered caption stays a plain wholly-failed error; the Gatewaymessage.actionboundary (createGatewayInflightUnavailableFailureinsrc/gateway/server-methods/send.ts) detects that partial-delivery error and preserves itsdeliveryResultonerror.details.partialDeliverywithretryable:false, so the receipt crosses the action/Gateway boundary instead of being dropped byString(err); the same boundary also preserves main's queued-delivery contract — a recovery-ownedOutboundDeliveryErroryieldserror.details.code = OUTBOUND_DELIVERY_QUEUED(the two outcomes are mutually exclusive, partial delivery first);retryableis set tofalseonly for a partial-delivery receipt and omitted otherwise (ordinary and queued failures carry noretryablesignal, matching main's shape so Gateway clients do not replay an indeterminate send); the nestedattachments[].imagealias is now collected just like the top-levelimagealias;thread-replyand the default outbound fallback are unchanged.autoreview: N/A (not available in this environment;
oxfmt --check,oxlint, and the feishu shard tests are green).Twentieth review round (rebase + merge-conflict resolution = P1 queued-delivery fix): rebased onto current
origin/main; the one merge conflict increateGatewayInflightUnavailableFailurewas resolved by composing both Gateway error outcomes — partial-delivery (details.partialDelivery+retryable:false) and queued-delivery (details.code = OUTBOUND_DELIVERY_QUEUEDfor recovery-ownedOutboundDeliveryError) — so main's queued-retry contract is preserved alongside the PR's partial-delivery receipt. The main-sidereports structured details for queue-owned retry / ordinary failureregression test is retained (pre-fix fail / post-fix pass re-verified), alongside the PR's partial-delivery regression.oxfmt --check,oxlint -c .oxlintrc.json,tsgo(core shard), andvitest(gateway-methods shard, 122 tests) are green.Twenty-first review round (two P1 fixes): (1) added
imagetoFEISHU_ATTACHMENT_MEDIA_SOURCE_PARAM_KEYSso a nestedattachments: [{ image: ... }]is collected as a media candidate instead of silently text-sending (regression test added:accepts a nested attachments[].image alias instead of dropping it, pre-fix fail / post-fix pass); (2) changedretryablefrom!partialDeliverytofalse-only-on-partial-delivery (omitted otherwise), restoring main's non-retryable shape for ordinary and queued failures so Gateway clients do not replay an indeterminate send (thereports structured detailsparameterized test now also assertsretryableisundefined; the plain-error test now assertsretryableisundefinedinstead oftrue; both pre-fix fail / post-fix pass).oxfmt --check,oxlint -c .oxlintrc.json,tsgo(core shard — only pre-existing maintuierrors unrelated to this PR), andvitest(gateway-methods 122 + feishu channel 151) are green.