Skip to content

TUI keeps stale streamed text when a terminal text.complete rewrite truncates it #688

Closed

Description

@agenteinstinct1-max

Observed

When a plugin's experimental.text.complete hook rewrites an assistant text part at text-end to a final text that is a strict prefix of the streamed text (including empty), the TUI keeps displaying the streamed text instead of the terminal one.

Example: a part streams Hello secret; the terminal rewrite returns Hello (or ""). The reducer's stale-prefix preservation runs before the terminal snapshot is accepted, so the displayed text remains Hello secret.

Reducer-level reproduction on dev-vibecoded (d6107cf): applying a terminal update with text Hello after streamed Hello secret leaves Hello secret in the part; applying terminal "" likewise keeps Hello secret.

Expected

The first terminal text snapshot is honored even when it truncates the streamed text to a prefix or to empty. Prefix preservation for non-terminal streamed updates stays as is.

Notes

  • The processor explicitly lets experimental.text.complete rewrite output before publishing the terminal snapshot; only the TUI reducer ordering drops the rewrite.
  • Reasoning parts are unaffected (separate prefix behavior).
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