Skip to content

[Bug]: Telegram streaming preview duplication with Anthropic-compatible providers (MiniMax) #18859

@vmhq

Description

@vmhq

Summary

When using MiniMax-M2.5 via its Anthropic-compatible endpoint (api.minimax.io/anthropic) with streamMode: "partial" on Telegram, streaming preview message is not finalized in place. Instead, a second duplicate final message is sent, despite fix in #17218 which works correctly with native Anthropic providers.

Steps to reproduce

  1. Configure a MiniMax provider with Anthropic-compatible API in openclaw.json:
    "minimax-portal": {
      "baseUrl": "https://api.minimax.io/anthropic",
      "apiKey": "minimax-oauth",
      "api": "anthropic-messages",
      "models": [{ "id": "MiniMax-M2.5", "reasoning": true }]
    }
  2. Set it as primary model: "primary": "minimax-portal/MiniMax-M2.5"
  3. Configure Telegram channel with "streamMode": "partial"
  4. Send any message to bot via Telegram
  5. Observe that streaming preview is sent, then a second duplicate final message is sent instead of preview being finalized in place

Expected behavior

The streaming preview message should be edited/finalized in place with the complete response, as implemented in #17218. Only one message should appear in the Telegram chat — not a preview followed by a separate final message.

This works correctly when using native Anthropic providers (e.g., anthropic/claude-sonnet-4-5). The issue only occurs with Anthropic-compatible third-party endpoints like MiniMax.

Actual behavior

Two messages appear in Telegram: first a streaming preview, then a separate final message with the complete response. The preview message is not edited in place — it remains as-is and a new message is appended.

This suggests that MiniMax's Anthropic-compatible streaming endpoint may emit different SSE event sequences (e.g., missing or differently formatted message_stop / content_block_stop events) compared to native Anthropic, causing the finalization logic from #17218 to not trigger.

OpenClaw version

2026.2.15

Operating system

Ubuntu 24.04

Install method

npm global

Logs, screenshots, and evidence

No gateway error logs — stream completes successfully, but preview finalization doesn't trigger. The result is two visible messages in the Telegram chat instead of one edited message.

Provider config:

"minimax-portal": {
  "baseUrl": "https://api.minimax.io/anthropic",
  "apiKey": "minimax-oauth",
  "api": "anthropic-messages"
}

Telegram config:

"streamMode": "partial"

Workaround: Setting `"streamMode": "off"` avoids the issue but disables streaming previews entirely.

Impact and severity

Affected: Telegram users using any Anthropic-compatible third-party provider (MiniMax, etc.)
Severity: Annoying — duplicate messages clutter the chat
Frequency: 100% reproducible on every message with streamMode: "partial"
Consequence: Users see every response twice in Telegram

Additional information

  • The fix in fix: Telegram stream preview finalizes in place #17218 works correctly with native Anthropic providers — this only affects Anthropic-compatible third-party endpoints.
  • MiniMax uses api.minimax.io/anthropic with api: "anthropic-messages", which may emit SSE streaming events in a slightly different format/sequence than native Anthropic.
  • Likely stream finalization detection logic relies on specific Anthropic SSE event patterns (message_stop, content_block_stop) that MiniMax may omit or format differently.
  • This could potentially affect other Anthropic-compatible providers beyond MiniMax.

Additional testing observations:

  • zai/glm-4.7: Streaming preview works correctly (message edits in real-time as it generates)
  • minimax-portal/MiniMax-M2.5: No preview streaming — complete message sent at end

Hypothesis confirmed:
The issue is indeed related to how MiniMax's Anthropic-compatible endpoint emits SSE streaming events. GLM-4.7 provides proper text_delta events that allow Telegram's preview streaming to update the message in place, while MiniMax appears to either:

  1. Not emit streaming events in a compatible format
  2. Emit them in a different sequence that preview streaming logic doesn't recognize

Environment:

  • OpenClaw version: 2026.2.15
  • OS: Ubuntu 24.04 (LXC container on Proxmox)
  • Telegram config: "streamMode": "partial"
  • MiniMax config: api: "anthropic-messages", baseUrl: "https://api.minimax.io/anthropic"

This confirms that streaming detection/finalization logic from #17218 works with native streaming providers but fails with Anthropic-compatible third-party endpoints like MiniMax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked 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