Repository navigation
🤖 Reloading during a message edit replaces the unsent draft with the edit text #5672
Copy link
Copy link
Open
Labels
Description
Activity
Picked up by the issue coordinator: workspace workspace-81, branch fix/reload-during-edit-draft
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high- added a commit that references this issue
on Oct 6, 2026 - added 10 commits that reference this issue
on Oct 6, 2026 Status: this issue stays open. #5893 closed unmerged (#5893 (comment)). #5801 stays a parked draft.
- Owner: the coordinator desk.
- Re-plan trigger: a user report of draft loss during an edit, or a design that is materially simpler than S1 below.
S1 trade-offs, for the next planner:
- S1: the composer's edit buffer is the only owner of the edit's text and files until the backend accepts the edit. No take and put-back, so 🤖 fix: keep an open edit out of the shared draft #5893's F1 and F2 cannot happen.
- Cost to users: the edit stays read-only while its send runs. A switch during an edit send that the backend then accepts leaves a visible duplicate in the draft.
- It still needs a busy gate, a decision when the target disappears during the send, and one merge for a queued-card race.
- Estimate: about +185/−60 production lines, against 🤖 fix: keep an open edit out of the shared draft #5893's +244/−55. Not materially simpler, so we stopped.
#5893's F1 and F3 on current main
7b9899ddc1:- F1 (edit opens while draft files still load): main loses nothing.
ChatInput/index.tsx:1334waits for the files. Until then the composer shows the unsent draft, and the snapshot at 1345 includes any typed text. - F3's path loses data on main. The queued card's Edit during an open edit replaces the edit with the queued message, and Cancel then drops that message and its note. A headless test on main fails. Filed as 🤖 Composer: the queued card's Edit during an open edit replaces the edit, and Cancel then loses the queued message #5934.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$173.34- addedinvestigationTriage: proposal / research / trackingTriage: proposal / research / tracking
on Oct 9, 2026
Problem: Start editing a message while the composer holds an unsent draft, then reload. Edit mode is gone, the edit text sits in the composer as a new-message draft, and the original unsent draft is lost. A later edit can then restore the leaked text as its "pre-edit draft".
Cause: entering edit mode writes the edit text into the normal persisted draft (
applyDraftFromPendinginChatInput/index.tsx). The edit target (ChatPaneeditingState) and the pre-edit draft (editSessionRef) live only in memory, so a reload keeps the text but loses both.Fix idea: keep the edit text out of the normal draft slot (memory only, or its own
edit-<id>scope), or persist the edit session so a reload can restore edit mode and the pre-edit draft.Priority P2 (typed input is lost). Size M.
Found by the agent bug bashes in #5670 (pre-existing, outside that PR's changes).
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high