Skip to content

Telegram partial streaming: final message delivered before streaming chunks (race condition) #20159

@yolo-maxi

Description

@yolo-maxi

Description

When channels.telegram.streamMode is set to "partial", the final message sometimes appears before the streaming preview edits complete. This causes the user to see what looks like backwards streaming — the full response flashes first, then earlier partial chunks overwrite it.

Environment

  • OpenClaw version: 2026.2.15
  • Channel: Telegram
  • Config: channels.telegram.streamMode: "partial"

Steps to Reproduce

  1. Enable `channels.telegram.streamMode: "partial"" in config
  2. Trigger a multi-paragraph response from the assistant
  3. Watch the Telegram chat

Expected Behavior

Preview message updates progressively with partial text, then final message replaces it cleanly.

Actual Behavior

Final message appears to send first, then gets overwritten by earlier streaming edits (appears to stream backwards). Eventually resolves to correct text.

Notes

  • May be a timing/ordering issue between the final edit and preceding preview edits
  • `streamMode: "block"" was not tested — may have similar or different behavior
  • draftChunk config: { minChars: 50, maxChars: 400, breakPreference: "sentence" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions