Skip to content

Preserve streamed messages when non-interactive diagnostics arrive #2377

Open

Description

@coderabbitai

Summary

Investigate and correct streamed-message ordering when a non-interactive diagnostic arrives between partial text updates.

At PR #1403 head 1471730e6d22d1817e113c3df7d3a11a3ae273db, the post-save diagnostics tail appends a complete say("error", ...) row. Task.say() finds a partial message to update only when it is the last message. If the diagnostic arrives after a partial text row but before its next update, the next update can create another text row and leave the original partial row unfinished. This ordering originates in the task message array; the webview rendering and persisted result should also be checked.

Affected areas

  • src/core/task/Task.ts: say() and persisted message ordering.
  • src/integrations/editor/DiffViewProvider.ts: asynchronous post-save diagnostic emission.
  • webview-ui/src/components/chat/ChatView.tsx and ChatRow.tsx: rendering and rehydration, as applicable.

Acceptance criteria

  • Preserve a single completed streamed text message when a diagnostic arrives between partial and final text updates. Preserve the diagnostic as a separate non-interactive error row.
  • Add a regression test for the persisted sequence: partial text, diagnostic, and final text. Verify that no orphaned partial or duplicate text row remains.
  • Check the corresponding webview rendering or rehydration behavior where needed, and preserve pending ask() behavior.

Requested by @easonLiangWorldedtech.

Context: #1403
Review discussion: #1403 (comment)

Activity

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