diff --git a/backend/app/channels/feishu.py b/backend/app/channels/feishu.py index 9ba97e233c..ee2e14fd7d 100644 --- a/backend/app/channels/feishu.py +++ b/backend/app/channels/feishu.py @@ -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( diff --git a/backend/tests/test_feishu_parser.py b/backend/tests/test_feishu_parser.py index 333c5cb35e..2b6188eb63 100644 --- a/backend/tests/test_feishu_parser.py +++ b/backend/tests/test_feishu_parser.py @@ -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())