mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-11-07 19:20:34 +00:00
fix(feishu): clear msg.files after receive_file downloads them (#7804)
receive_file downloaded each image/file descriptor and replaced the
[image]/[file] placeholders in msg.text, but left msg.files intact. The
generic URL-based _ingest_inbound_files pass then re-walked the residual
{"image_key":...}/{"file_key":...} descriptors, found no url, and logged a
spurious 'reader returned no data' warning per file.
Clear msg.files after materializing the paths, matching DingTalk (msg.files =
[]) and the Slack/Telegram/Discord providers (which materialize them).
Co-authored-by: lisry-1 <249596828+lisry-1@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
parent
e163b02bea
commit
c0b0ac3489
@ -733,6 +733,9 @@ class FeishuChannel(Channel):
|
||||
virtual_path = await self._receive_single_file(msg.thread_ts, file["file_key"], "file", thread_id, user_id=user_id)
|
||||
replace_next_placeholder("[file]", virtual_path)
|
||||
msg.text = text
|
||||
# Clear the descriptors so the generic URL-based _ingest_inbound_files
|
||||
# pass does not try to re-fetch files that were downloaded by key.
|
||||
msg.files = []
|
||||
return msg
|
||||
|
||||
async def _receive_single_file(
|
||||
|
||||
@ -513,6 +513,7 @@ def test_feishu_receive_file_replaces_placeholders_in_order():
|
||||
result = await channel.receive_file(msg, "thread_1")
|
||||
|
||||
assert result.text == "before /mnt/user-data/uploads/a.png middle /mnt/user-data/uploads/b.pdf after"
|
||||
assert result.files == []
|
||||
|
||||
_run(go())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user