PRG-07: Media & image context bundle (from #343 #334)#370
PRG-07: Media & image context bundle (from #343 #334)#370nap-liu wants to merge 2 commits intodataelement:mainfrom
Conversation
…models Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
wisdomqin
left a comment
There was a problem hiding this comment.
Thanks for combining these two features into a single, well-structured PR — the commit history and scope description are clean.
After reviewing both parts carefully, here is our decision:
DingTalk Media Support (#334) — Accepted
The DingTalk media message support is a solid contribution. The new dingtalk_token.py global cache manager, the dingtalk_reaction.py thinking indicator, the reconnect-with-backoff logic in dingtalk_stream.py, and the media download+dispatch pipeline are all well-implemented and production-ready.
Action needed: We have merged several changes to main recently (including standalone search engine tools and a seeder fix). Please rebase your branch on the latest main and open a new PR containing only the DingTalk media support files:
backend/app/api/dingtalk.pybackend/app/services/dingtalk_stream.pybackend/app/services/dingtalk_token.py(new)backend/app/services/dingtalk_reaction.py(new)
We will prioritize reviewing and merging that PR.
Image Context Rehydration (#343) — We will implement this ourselves
We appreciate the thinking behind this feature. However, after discussion, we believe the read-time rehydration approach (scanning history and re-reading from disk on every LLM call) has some architectural concerns:
- Disk dependency: if the file is moved or cleaned up, context silently breaks
- Coverage gap: only handles
workspace/uploads/— images from tool execution or channel messages are not covered - Repeated disk I/O on every LLM call as conversation history grows
We plan to address this at the write path instead: when saving a message that contains an image, we will persist the [image_data:data:image/...;base64,...] marker directly in the DB alongside the message content. This way, history is self-contained and no rehydration step is needed at inference time.
We will implement this change ourselves and it will apply to all channels (web chat, Feishu, DingTalk) uniformly.
No action needed from you on this part — we will close this item once our implementation lands.
Thank you again for the high-quality contributions. Looking forward to the DingTalk-only PR!
|
Thanks for the detailed review! I've extracted the DingTalk media support into a standalone PR rebased on latest → #392 It includes:
Image context rehydration (#343) has been excluded as requested. This also supersedes PR #369 (reconnect-only), since the reconnect logic is already included here. |
This regrouped PR combines the original changes from:\n- #343 image-context-rehydration\n- #334 dingtalk-media-support\n\nScope: media ingestion and image-context recovery behavior.