Repository navigation
fix(feishu): honor the filename override on sent attachments - #205287
Conversation
The Feishu send action dropped a caller-supplied filename at the action and outbound handoffs, so attachments were uploaded under the media path basename. Carry the normalized override through the outbound context into sendMediaFeishu. The attachment-intent resolver and plugin-local outbound media type move to sibling modules because their owning files are capped. Closes openclaw#205246 Co-Authored-By: Claude Code <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesPreserves the caller’s attachment filename through Feishu’s action handler and outbound adapter into the existing uploader. Example: Send /tmp/report_en.pdf with filename "季度报告.pdf".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR repairs a concrete Feishu filename bug still present on current main; no introduced correctness defect was found. Reviewed head: Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Feishu plugin receives message actions, resolves attachment sources, and passes media plus display-name metadata through its outbound adapter to the Lark upload and message APIs. flowchart LR
A[Message action] --> B[Feishu action handler]
B --> C[Outbound adapter]
C --> D[Existing media uploader]
D --> E[Lark upload and message APIs]
Technical reviewBest possible solution: Carry the existing filename metadata through Feishu’s two handoffs while retaining the uploader’s current precedence, sanitization, and media-access controls. Do we have a high-confidence way to reproduce the issue? The official-release report and current source establish the dropped filename at both Feishu handoffs; this read-only review performed no live reproduction. Is this the best way to solve the issue? The repair uses the existing uploader and keeps filename propagation plugin-local; the module moves preserve behavior and satisfy the repository’s line-cap constraints. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 283b6d7dc96f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Tests +19. Total +33 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 25, 2026, 6:06 AM ET / 11:06 UTC. |
- Revert the 94-line move of resolveFeishuSendAttachmentMedia into send-attachment.ts. - Pass the filename override on the direct-send outbound context in one line and map it to sendMediaFeishu's fileName. - Reuse the SDK jsonResult instead of the local jsonActionResult copy so channel.ts stays within its line-cap ratchet against main.
|
Gateway proof for #205246 (built dist in secretless Docker, bundled Feishu plugin, local Feishu Open API stand-in recording the uploaded |
|
Merged in 5271519. Thanks @erywim for the fix and @Cindypapa for the precise reproduction in #205246. When the |
…w#205287) Root cause: extensions/feishu/src/channel.ts:942 (on 5279ca4) builds the direct-send `outboundContext` from the action params without `filename`, so `feishuOutbound.sendMedia` calls `sendMediaFeishu` (extensions/feishu/src/outbound.ts:736) with no `fileName` and the upload falls back to the loaded media basename (extensions/feishu/src/media.ts:581). Fixes openclaw#205246 Thanks @Cindypapa for the report, the server-side `im/v1/messages` evidence and the Chinese-name control case, and @erywim for the fix. ## What Problem This Solves Sending a local file through the `message` tool with an explicit `filename` delivered the Feishu attachment under the media path's basename. For example, `media: "/tmp/repro/report_en.pdf"` with `filename: "季度报告.pdf"` arrived as `report_en.pdf`, and the call still reported success. ## Why This Change Was Made The Feishu `send` / `thread-reply` action now puts the caller's `filename` on its outbound context, and the plugin's `sendMedia` passes it to the `fileName` parameter `sendMediaFeishu` already supports. The upload already gives an explicit `fileName` precedence over the loaded name. The presentation-fallback media send reuses the same context, so it inherits the override too. `channel.ts` and `outbound.ts` sit above their line caps and may not grow. Instead of moving the attachment resolver out of `channel.ts`, the plugin now uses the SDK's `jsonResult` in place of its local copy (`jsonActionResult`, same body), and the plugin-only `FeishuOutboundSendMedia` type moves to `outbound-types.ts`. ## User Impact Agents and operators can set the attachment name recipients see without renaming files on disk. Sends without `filename` keep the media path basename. Images are unchanged. Only the Feishu plugin changes; the shared `message` send path for other channels is untouched. ## Evidence Built Gateway (`pnpm build`) in a secretless node:24.22.1 container with the bundled Feishu plugin, pointed at a local HTTPS stand-in for the Feishu Open API that records the multipart `file_name` from `im/v1/files` and serves `im/v1/messages`. A scripted model calls the `message` tool with the reporter's exact args; the turn runs through `openclaw agent --reply-channel feishu --reply-to chat:oc_repro --deliver`. - Base vs candidate, twice each plus controls (no `filename`, Chinese-named file, image): openclaw#205287 (comment). Base uploads `report_en.pdf`; the candidate uploads `季度报告.pdf`; controls are unchanged. - Regression test in `extensions/feishu/src/outbound.send-authority.test.ts` drives `handleAction({ action: "send", media, filename })` through the registered adapter and Feishu transport and checks the uploaded multipart body. ## Merge danger Two-way door: a revert restores the old naming. No config, schema, stored state or public contract changes. Blast radius: Feishu direct `send` / `thread-reply` media uploads that pass `filename`. Co-authored-by: Claude Code <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause: extensions/feishu/src/channel.ts:942 (on 81d69df) builds the direct-send `outboundContext` from the action params without `filename`, so `feishuOutbound.sendMedia` calls `sendMediaFeishu` (extensions/feishu/src/outbound.ts:736) with no `fileName` and the upload falls back to the loaded media basename (extensions/feishu/src/media.ts:581). Fixes #205246 Thanks @Cindypapa for the report, the server-side `im/v1/messages` evidence and the Chinese-name control case, and @erywim for the fix. ## What Problem This Solves Sending a local file through the `message` tool with an explicit `filename` delivered the Feishu attachment under the media path's basename. For example, `media: "/tmp/repro/report_en.pdf"` with `filename: "季度报告.pdf"` arrived as `report_en.pdf`, and the call still reported success. ## Why This Change Was Made The Feishu `send` / `thread-reply` action now puts the caller's `filename` on its outbound context, and the plugin's `sendMedia` passes it to the `fileName` parameter `sendMediaFeishu` already supports. The upload already gives an explicit `fileName` precedence over the loaded name. The presentation-fallback media send reuses the same context, so it inherits the override too. `channel.ts` and `outbound.ts` sit above their line caps and may not grow. Instead of moving the attachment resolver out of `channel.ts`, the plugin now uses the SDK's `jsonResult` in place of its local copy (`jsonActionResult`, same body), and the plugin-only `FeishuOutboundSendMedia` type moves to `outbound-types.ts`. ## User Impact Agents and operators can set the attachment name recipients see without renaming files on disk. Sends without `filename` keep the media path basename. Images are unchanged. Only the Feishu plugin changes; the shared `message` send path for other channels is untouched. ## Evidence Built Gateway (`pnpm build`) in a secretless node:24.22.1 container with the bundled Feishu plugin, pointed at a local HTTPS stand-in for the Feishu Open API that records the multipart `file_name` from `im/v1/files` and serves `im/v1/messages`. A scripted model calls the `message` tool with the reporter's exact args; the turn runs through `openclaw agent --reply-channel feishu --reply-to chat:oc_repro --deliver`. - Base vs candidate, twice each plus controls (no `filename`, Chinese-named file, image): #205287 (comment). Base uploads `report_en.pdf`; the candidate uploads `季度报告.pdf`; controls are unchanged. - Regression test in `extensions/feishu/src/outbound.send-authority.test.ts` drives `handleAction({ action: "send", media, filename })` through the registered adapter and Feishu transport and checks the uploaded multipart body. ## Merge danger Two-way door: a revert restores the old naming. No config, schema, stored state or public contract changes. Blast radius: Feishu direct `send` / `thread-reply` media uploads that pass `filename`. Co-authored-by: Claude Code <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 5271519) Backport adaptation: Preserved the release channel action type import while forwarding the normalized filename and using the source outbound context and JSON result helper. Co-authored-by: RomneyDa <[email protected]>
…chiving (#205026) * fix(sessions): keep inactive chats eligible for cold storage after archiving * test(sessions): align archive fixtures and identity baseline * test(sessions): create a private cold backup restore target (cherry picked from commit 81d69df) Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; ece7a74 improve(workboard): apply the Control UI glossary and style to Workboard copy [not selected for this narrow backport]; b616036 refactor(subagents): simplify ACP spawn relay ownership (#207023) [not selected for this narrow backport]; 93ca762 improve: reduce allocations when preparing session rows (#207109) [not selected for this narrow backport]; 9993328 refactor(subagents): simplify kill claim and ownership handling (#207025) [not selected for this narrow backport]; 97815bd refactor(subagents): consolidate registry cleanup and publication guards (#207064) [not selected for this narrow backport]; e94f799 refactor(subagents): centralize requester turn matching (#206584) [not selected for this narrow backport]; ea77ca3 refactor: report update failures from recorded runs (#206700) [not selected for this narrow backport]; 4d7e00b fix: let started participant runs and requests finish after an access change (#206747) [not selected for this narrow backport]; f89ae43 refactor(subagents): use cleanup and terminal owners in sweeps (#206533) [not selected for this narrow backport]; a882e0f fix(agents): preserve task answers when sessions are reused (#126263) [not selected for this narrow backport]; 81fc833 refactor(subagents): own dormant child Stop decisions (#206479) [not selected for this narrow backport]; 91d4912 fix(update): stop using foreign recovery records as admission (#206295) [not selected for this narrow backport]; be3c73e fix(subagents): finish claimed stops after session rotation (#206405) [not selected for this narrow backport]; ed8b883 fix(update): settle after plugins and share one completion summary (#205987) [not selected for this narrow backport]; 1de306e fix: pause interrupted shell turns when their result is unknown (#205859) [separately ordered lane row]; 16a6aa4 fix(memory): keep a child's memory audience after its parent resets (#205887) [not selected for this narrow backport]; 50a7368 feat: let agents snooze a conversation after replying [not selected for this narrow backport]; 40f3903 fix(ci): remove unused role and workflow exports (#205720) [not selected for this narrow backport]; e43debf refactor(state): migrate in place and remove copy-and-swap (#205165) [not selected for this narrow backport]; 8027293 refactor(plugins): plugin tools take the turn's owner bit; delete the requester-owner continuation (OA2 PR 6j) (#205483) [not selected for this narrow backport]; 13e2ec3 feat: let participants publish through the session's shared GitHub account (#204914) [not selected for this narrow backport]; 5434992 fix: use the configured runtime when switching model providers (#203973) [not selected for this narrow backport]; 5271519 fix(feishu): honor the filename override on sent attachments (#205287) [not selected for this narrow backport]; ca087d4 refactor(admission): drop the replay automationAdmin bit and the R7 source re-check (#205268) [not selected for this narrow backport] Co-authored-by: RomneyDa <[email protected]>
Root cause: extensions/feishu/src/channel.ts:942 (on 81d69df) builds the direct-send
outboundContextfrom the action params withoutfilename, sofeishuOutbound.sendMediacallssendMediaFeishu(extensions/feishu/src/outbound.ts:736) with nofileNameand the upload falls back to the loaded media basename (extensions/feishu/src/media.ts:581).Fixes #205246
Thanks @Cindypapa for the report, the server-side
im/v1/messagesevidence and the Chinese-name control case, and @erywim for the fix.What Problem This Solves
Sending a local file through the
messagetool with an explicitfilenamedelivered the Feishu attachment under the media path's basename. For example,media: "/tmp/repro/report_en.pdf"withfilename: "季度报告.pdf"arrived asreport_en.pdf, and the call still reported success.Why This Change Was Made
The Feishu
send/thread-replyaction now puts the caller'sfilenameon its outbound context, and the plugin'ssendMediapasses it to thefileNameparametersendMediaFeishualready supports. The upload already gives an explicitfileNameprecedence over the loaded name. The presentation-fallback media send reuses the same context, so it inherits the override too.channel.tsandoutbound.tssit above their line caps and may not grow. Instead of moving the attachment resolver out ofchannel.ts, the plugin now uses the SDK'sjsonResultin place of its local copy (jsonActionResult, same body), and the plugin-onlyFeishuOutboundSendMediatype moves tooutbound-types.ts.User Impact
Agents and operators can set the attachment name recipients see without renaming files on disk. Sends without
filenamekeep the media path basename. Images are unchanged. Only the Feishu plugin changes; the sharedmessagesend path for other channels is untouched.Evidence
Built Gateway (
pnpm build) in a secretless node:24.22.1 container with the bundled Feishu plugin, pointed at a local HTTPS stand-in for the Feishu Open API that records the multipartfile_namefromim/v1/filesand servesim/v1/messages. A scripted model calls themessagetool with the reporter's exact args; the turn runs throughopenclaw agent --reply-channel feishu --reply-to chat:oc_repro --deliver.Base vs candidate, twice each plus controls (no
filename, Chinese-named file, image): fix(feishu): honor the filename override on sent attachments #205287 (comment). Base uploadsreport_en.pdf; the candidate uploads季度报告.pdf; controls are unchanged.Regression test in
extensions/feishu/src/outbound.send-authority.test.tsdriveshandleAction({ action: "send", media, filename })through the registered adapter and Feishu transport and checks the uploaded multipart body.Merge danger
Two-way door: a revert restores the old naming. No config, schema, stored state or public contract changes. Blast radius: Feishu direct
send/thread-replymedia uploads that passfilename.