qwen-code/docs/users/features/channels
qqqys 36c77ff803
fix(dingtalk): attach media from quoted messages (#9347)
* fix(dingtalk): attach media from quoted messages

* fix(dingtalk): keep the reply text when attaching quoted media

R1-1: `attachMedia`'s placeholder cleanup was written for the direct-media
path, where `extractContent` generates `(audio)` / `(video)` /
`(file: name)` itself. This PR made the quoted-media path reach it, and there
`envelope.text` is the user's own reply — so a reply reading exactly like one
of those placeholders was blanked and the agent got an attachment with no
prompt. A group `@Bot (audio)` arrives here as exactly `(audio)`, the mention
having been stripped upstream. `attachMedia` now takes the placeholder to
erase as a parameter; only the direct-media call site passes one.

R1-2: the same path newly routes text-only replies through the unguarded
`mkdirSync`/`writeFileSync`/`basename` block. Those are synchronous throw
sites — ENOSPC on a write of up to 50 MB, ENAMETOOLONG from a quoted fileName
over 255 bytes (`basename` does not truncate), a TypeError from a truthy
non-string fileName. An escape rejects `processMessage`, whose catch sends
the generic error reply and never calls `handleInbound`; the msgId is already
in `seenMessages`, so DingTalk's retry is deduped and the prompt is lost for
good. The block now degrades the way a failed download already does: log,
skip the attachment, deliver the text. This also covers the pre-existing
direct-media path.

Verified: dingtalk 310/310. Both mutation-checked — restoring the caller-blind
cleanup fails 3 tests, letting the fs block throw fails 1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(dingtalk): address quoted-media review findings

Unify the msgType->mediaType mapping in a shared helper, make extractContent
the single source of truth for the placeholder text cleaned on attach, and
remove the store directory when a media write fails so failed stores no longer
leak into tmpdir. Merge the stacked attachMedia JSDoc blocks, document quoted
media downloads, and pin the previously uncovered paths: unmapped quoted
msgTypes with a downloadCode, own-media + quoted-media combinations, direct
placeholder cleaning, and the degraded-store attachment shapes.

* fix(dingtalk): file-back a quoted image colliding with the own image

* fix(dingtalk): give generated media store names a mime-derived extension (#9347)

---------

Co-authored-by: qqqys <266654365+qqqys@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot[bot]@users.noreply.github.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
2026-08-20 03:18:32 +00:00
..
_meta.ts feat(channels): add GitLab polling channel adapter (#7862) 2026-07-29 14:28:31 +00:00
dingtalk.md fix(dingtalk): attach media from quoted messages (#9347) 2026-08-20 03:18:32 +00:00
feishu.md feat(feishu): enrich observed contact labels (#8569) 2026-08-07 16:41:37 +00:00
github.md feat(channels): support group pairing (#8440) 2026-08-07 09:20:18 +00:00
gitlab.md feat(channels): support group pairing (#8440) 2026-08-07 09:20:18 +00:00
overview.md feat(web-shell): redesign Channel policy and workspace management (#8848) 2026-08-14 07:41:44 +00:00
plugins.md feat(web-shell): redesign Channel policy and workspace management (#8848) 2026-08-14 07:41:44 +00:00
qqbot.md feat(channels): support group pairing (#8440) 2026-08-07 09:20:18 +00:00
telegram.md feat(channels): support group pairing (#8440) 2026-08-07 09:20:18 +00:00
wecom.md feat(channels): support group pairing (#8440) 2026-08-07 09:20:18 +00:00
weixin.md feat(channels): add crash recovery and gateway mode support 2026-03-26 02:55:18 +00:00