mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-26 13:16:24 +00:00
* fix(frontend): keep composer context when an attachment upload fails sendMessage called onSent right after the in-flight guard, before any attachment was prepared or uploaded. The composer's onSent drops its one-time state there: quotes, conversation references, staged project files and the stored draft. PromptInput keeps the text and files when the upload rejects, so the user saw the same message and retried it, but the retry went out without that context. onSent now fires once the send is dispatched: after the attachments upload, right before the run is submitted. A failed preparation or upload rejects first, so every caller (the chat composer and the side chat) keeps its state for a retry. Because onSent can now arrive after the composer has moved to another conversation, InputBox checks which conversation it shows. If it changed, onSent leaves that conversation's live state alone and retires only the sending conversation's stored draft and staged files, through a new clearProjectAttachments helper that does not touch mounted state. The chat E2E that held an attachment upload asserted the draft was gone mid-upload, which encoded the old timing. It now asserts the draft stays stored while the upload is pending and is gone, without being rewritten, once the send is dispatched. * docs(changelog): reference #6412 * docs(frontend): note onSent's guarantee ends at dispatch * fix(frontend): retire only what a detached send carried A send whose upload finishes after its composer unmounted still took the live path, because only a conversation switch was detected, and could delete a draft a new composer saved under the same reusable key. A late send also cleared the thread's whole staged list, dropping a document attached during the upload. Track the composer's lifetime instead of its key, and in the detached path clear the stored draft only while it still holds the sent text and retire only the staged entries the send captured. --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>