Skip to content

🤖 Composer: Edit in one window also loads the message into another window's composer #5571

Description

@ThomasK33

Summary

Reported during PR #5547 dogfooding, not yet verified independently: when a user clicks Edit on a sent message in one window, the edited message also appears in the composer of a second window that shows the same workspace.

The worker who reported it says origin/main behaved the same before #5547, so this is not a regression from the send-ID work.

Expected

Only the window where the user clicked Edit enters edit mode and shows the message in its composer.

Next step

Reproduce with two windows (dev-server sandbox + agent-browser) on current main, then decide whether edit state is per-window UI state or shared draft state. Related: #5547, #5567, #5557.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

  1. self-assigned this
    on Oct 3, 2026
  2. ThomasK33 commented on Oct 3, 2026

    @ThomasK33
    MemberAuthor

    Picked up by the issue coordinator: workspace workspace-68, branch fix/5571-edit-window-local


    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $

  3. ThomasK33 commented on Oct 3, 2026

    @ThomasK33
    MemberAuthor

    Triage: B (multi-window design needed). Reproduced on main eea905df90.

    Repro (dev server, mock model, two browser clients on one workspace):

    1. Window A sends "first message to edit".
    2. Window B opens the same workspace. Its composer is empty.
    3. Window A clicks Edit. A shows "Edit your last message" with the text.
    4. Window B's normal composer ("Message Claude", not in edit mode) now also holds "first message to edit". If B presses Send, the message goes out a second time.
    5. Window A presses Escape. Both composers are empty again.

    Window B after A clicked Edit

    Cause: edit mode is per-window React state (ChatPane editingState), but entering edit writes the message into the composer's draft (ChatInput applyDraftFromPending), and the draft is the backend-shared {kind: "workspace"} scope. DraftStore pushes it to every window. The pre-edit draft lives only in window A's memory (editSessionRef.preEditDraft), so a reload during edit also loses it.

    Why B: a fix must decide where edit text lives. Proposed design: while editing, the composer edits a memory-only per-window scope (DraftStore already has memory-only scopes), and the shared workspace draft stays untouched. That removes the pre-edit snapshot/restore, keeps other windows' drafts, and changes one behavior: edit text no longer survives a reload. It touches the edit session, send settle and restore paths in ChatInput, so it is not a small single-path fix.

    Window B after A clicked Edit

    Window A in edit mode


    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $

  4. ThomasK33 commented on Oct 3, 2026

    @ThomasK33
    MemberAuthor

    Decision: backlog until the maintainer picks the product tradeoff. User-visible risk today: after Edit in window A, Send in window B sends the message a second time, and Escape in window A also empties window B's composer (B's own draft text is replaced while A edits). The proposed fix (a memory-only per-window edit scope) means edit text no longer survives a reload.


    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $2.57

  5. ThomasK33 commented on Oct 4, 2026

    @ThomasK33
    MemberAuthor

    Maintainer decision (2026-10-04): this stays in the backlog. The repro and risk are recorded above:

    • Clicking Edit in window A also loads the message into window B's composer.
    • Send in window B then duplicates the message.
    • Escape in window A empties both composers.

    The proposed fix keeps a per-window edit scope in memory only. It trades away edit text surviving a reload, so it's deferred. Trigger: a user report, or other work on how composer drafts sync across windows.


    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

  6. ThomasK33 commented on Oct 9, 2026

    @ThomasK33
    MemberAuthor

    Status: this issue stays open. #5893 closed unmerged (#5893 (comment)). #5801 stays a parked draft. The same work covers this issue and #5672.

    • 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. The edit never enters the shared draft, so other windows never see it.
    • 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.

    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $173.34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions