Skip to content

[Bug]: Telegram streaming=partial silently drops response when model fallback occurs mid-stream #44340

Description

@nicks2bo

Summary

When streaming: "partial" is enabled on Telegram and a model fallback occurs mid-stream (e.g., primary model hits 429 rate limit), the response is silently dropped — the user receives nothing.

Steps to Reproduce

  1. Set channels.telegram.streaming: "partial"
  2. Configure a primary model (e.g., google/gemini-flash-latest) with fallbacks
  3. Send a message that triggers a slow/long response
  4. Primary model hits 429 rate limit ~14s into processing
  5. Gateway falls back to secondary model (e.g., anthropic/claude-sonnet-4-6)
  6. Secondary model generates and completes the response

Expected: User receives the completed response from the fallback model.
Actual: User receives nothing. Response is silently dropped.

Root Cause (from cache-trace logs)

When partial streaming is active, a draft message is sent to Telegram immediately using the primary model's output. When the primary model fails and a fallback takes over, the gateway attempts to edit the existing draft message with the new response. If the Telegram draft has expired or the edit fails (e.g., due to timing), the failure appears to be silent — no retry, no new message sent.

Evidence from session logs:

  • 18:36:29 — User message received, processed by gemini-flash-latest
  • 18:36:44 — Model snapshot changes to claude-sonnet-4-6 (fallback)
  • 18:39:43 — Assistant response written to session store
  • User receives no message on Telegram

Requested Fix

When a model fallback occurs mid-stream and the draft edit fails (any error from Telegram API), the gateway should:

  1. Detect the delivery failure
  2. Send the completed response as a new message (instead of editing the failed draft)
  3. Optionally: delete the stale partial draft before sending the new message

This would make fallbacks seamless and invisible to the user.

Environment

  • OpenClaw v2026.3.8
  • Channel: Telegram
  • Primary model: google/gemini-flash-latest
  • Fallback model: anthropic/claude-sonnet-4-6
  • streaming: "partial"
  • retry: { attempts: 5, minDelayMs: 2000, maxDelayMs: 30000, jitter: 0.3 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions