Skip to content

fix(tui): preserve streamed text when settling orphaned parts #691

Closed

Description

@agenteinstinct1-max

Description

A surviving TUI loses streamed text when the prompt loop settles an orphan: deltas are published but not projected, so the terminal recovery snapshot may contain an empty or partial durable value. Since #686 treats the first terminal text snapshot as an authoritative plugin rewrite, it replaces the visible text. Hydration separately keeps nonempty local text against any empty snapshot, including a legitimate plugin deletion, and can miss the terminal time.

Steps to reproduce

  1. Persist an unfinished assistant text part and publish text deltas to a live consumer.
  2. Run the prompt loop so its orphan settlement reads the durable row and publishes it with an end time.
  3. Observe the streamed text disappear. Hydrating an empty terminal plugin rewrite over streamed text instead incorrectly preserves it.

Recovery needs distinguishable provenance in both live updates and hydrated rows; plugin prefix/empty rewrites and terminal ordering must remain intact. Recovery cannot reconstruct deltas that no consumer retained.

OpenCode version

dev-vibecoded at ce4c4f3

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions