Skip to content

A rewind's prefill can come from the engine's last-prompt row, which is trimmed and has its line breaks turned into spaces #740

Closed

Description

@SSFSKIM

What

A rewind puts the rewound message's words back into the composer's draft. One source of those words is the engine's last-prompt metadata row: src/engine-host/fs/chain-follower.ts reads record.lastPrompt into the rewind boundary's prefillText.

An engine probe on the UX wave's U1c link (engine 2.1.322; spikes/protocol-probe/findings-uxwave-u1c-writer-forms.txt on the branch ux-wave/u1c-writer-probe) observed that this metadata row is not the text the person sent: leading and trailing white space is trimmed and every line break is turned into a space. The message's own row holds the text exactly as sent.

So a rewind that takes its words from lastPrompt prefills a multi-line message as one line.

The session summary's firstPrompt also falls back to lastPrompt (src/engine-host/fs/summarize.ts), but only for a title, where a one-line copy is what is wanted; that use is fine.

Wanted

The rewind's prefill reads the rewound message's own row where one exists, and falls back to lastPrompt only when it does not.

Acceptance

  • A unit case: a rewound prompt of three lines prefills three lines.
  • First establish, from the recorded fixtures, which rewinds today take their words from lastPrompt and which from the row, so the case pins a path a person can reach.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 17, 2026
  2. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    Ticket 733a frames MAWS's composed forms. A rewind to a message of one of them (a plan after a clear, a promoted side question, a comment with a quoted line) fills the composer with the engine's text, which holds no frame, so the model's content is sent again as the person's words with no line left out. When this ticket moves the prefill to the message row, route the send through composedPrefill (src/renderer/src/composer/composed-prefill.ts), as Edit on a bubble does.

    (Recorded as a row of docs/tech-debt-tracker.md on branch ux-wave/733-paste-consent, head b413eb4.)

  3. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    Re-scoped (batch 7, group A, with the coordinator's agreement). Checked against master 5e8534042 and the recorded fixtures:

    • The composer's rewind prefill does not read lastPrompt. The rewind picker fills the composer from the rewind_conversation answer's prefillText (RewindWidget.tsx, src/engine-host/rewind.ts). Engine 2.1.322 builds that from the rewound message's own row (stackedOriginalInput || <the message content's text>), and in uxwave/u3b-editcmp-one, -two and -two-above it equals the row's text exactly.
    • lastPrompt reaches only the rewind line's hover title. The chain follower's prefillText from last-prompt goes into the boundary row's detail (derive.ts), which Boundary.tsx shows as title. This applies to rewinds read from the session's file.
    • That lastPrompt is the session's latest prompt, not the rewound one. The engine writes currentSessionLastPrompt. In p5/p5-o3-rewind-resume-post the cut message is T3 and the anchor's lastPrompt is T4. In -pre and -pre-files the cut message is T2 and lastPrompt is T3. It is empty in -pre-release, both -kill-after-rewind recordings and every u3b-fork-* recording. So the title can name another message's words, which is worse than the flattened line the body describes.

    New scope: the rewind line's title reads the rewound message's own row from the branch the rewind hid, in derive. Where the state does not hold that row, the title is empty: no title is better than a wrong one. The chain follower is left as it is. Red case: p5-o3-rewind-resume-post through the file route, where the title must not read T4.

    Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)

  4. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 20, 2026
  5. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: batch 7, group A

  6. added
    status:in-review
    and removed
    status:in-progress
    on Nov 20, 2026
  7. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: batch 7, PR #804

  8. removed
    status:in-review
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions