Repository navigation
Conversation
Resolve explicitly linked images through the existing workspace reader, upload them to Feishu, and retain per-job delivery progress and idempotency keys across retries.
Respect code blocks, escaped markers and variable backtick spans, and resolve balanced destinations and reference image definitions using mdast. Add regressions for both review findings.
Fei2411
left a comment
There was a problem hiding this comment.
Verdict: COMMENT — defer; not ready to review for merge yet (draft).
The approach looks sound: images are read through the existing markdown-image endpoint, so workspace, symlink, size and Session checks are reused, and only local Markdown images are taken, not code examples or remote URLs. A few things need to happen before a full review:
- Base it on the snapshot fix that will land. The body says live validation depends on #1768, but #1768 is being recommended for closure in favour of #1750. Please validate against #1750 instead.
- Feishu card structure. #1680 replaces the schema-2.0
actioncontainer withcolumn_setbuttons, and #1670 turns every chunk into a card. This PR touches the samesendpath in feishu.js, so merge dev after those land and re-check. - New runtime dependency.
mdast-util-from-markdown(+613 lines of lockfile) needs maintainer approval under the repo rules. If the extraction can reuse a parser DS Bot or DSH already ships, that would be preferable. Otherwise keep the NOTICE entry and justify the choice in the PR body. - The PR template asks for screenshot/GIF evidence of a real Feishu delivery when it leaves draft.
Mark it ready once 1–3 are settled, and I'll do a full review.
Fei2411
left a comment
There was a problem hiding this comment.
Needs changes now that this is out of draft. Rechecking on current dev, #1680's Feishu card work is already merged and combines cleanly with this branch; #1670 is still open. The remaining code issue I reproduced is partial delivery: ds-bot/src/host/im/platforms/feishu.js:408–441 sends text first, then awaits each image inside the same cursor loop. If the first image is missing, a valid second image is never read. The image endpoint reports bot/not-found without HTTP status; the IM queue classifies that as retryable (ds-bot/src/host/im/index.js:537–540,619–634) and revisits the same missing image on every retry. In my mock, a missing image followed by a valid one sent text only across two attempts; the valid image sent normally in isolation. Please isolate permanent per-image read/validation failures so later valid images can deliver, while still resuming on transient upload/send failures without repeating text. Please also validate against #1750 rather than the now-closed #1768.
|
感谢贡献!IM 回复原生发图已由支持 6 个平台的 #1868 覆盖,本草稿 PR 先致谢关闭。 |
Issue
Fixes #1761
A Bot reply such as
can render an image in DS Bot while Feishu receives only its local Markdown path. The adapter never uploads those bytes or sends an image key.What changed / 改了什么
markdown-imageendpoint, preserving its workspace, private-data-folder, symlink, size and Session checks. No second unrestricted filesystem reader is introduced.image_type=message, then send the returnedimage_keyas a native Feishu image to the originating chat.mdast-util-from-markdown(declared/pinned MIT dependency, attributed in NOTICE), excluding code/escaped examples and resolving balanced destinations and image-reference definitions.This is a focused companion to #1670 (Markdown cards) and #1680 (inbound rich posts/v2 buttons), and overlaps the Feishu image portion of #1257. It leaves their behavior changes to those PRs. The existing mixed-source/no-origin rule remains enforced. Typed deliverables and arbitrary remote image downloading are outside this patch; it handles local Markdown images explicitly included in a reply.
Changelog
Feishu now receives images explicitly linked in Bot replies as native pictures, including group-member replies, with workspace checks and retry-safe delivery.
飞书现在可以收到 Bot 回复中明确引用的本地图片,群聊成员回复同样支持,并保留工作目录检查及重试去重。
How I checked it / 怎么验证的
node --test test/im-feishu.test.js test/im-feishu-images.test.js— 35 passed after the review fixes.devadapter, the ten new cases produce 7 failures; the patched adapter passes all ten.node scripts/build-client.mjs --check.git diff --check.npm run lint: passed (existing warnings only).src/client/is unchanged.Checklist / 检查
src/client/unchanged; no generated client edit.Opened as a draft from the reporter's fork. I recognize the current collaborator-only contribution policy; the linked issue and commit remain available for a collaborator to review or integrate if external PRs are not accepted.
Review follow-up
Commit
fff96f0replaces the regular-expression extractor with Markdown AST parsing and adds regressions for both review findings. Devin posted Resolved replies for both threads. The separate Harness snapshot origin failure is tracked and fixed by #1767 / #1768.