fix(telegram): use message transport for all DM streaming lanes#38906
fix(telegram): use message transport for all DM streaming lanes#38906gambletan wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…claw#33453) Draft transport in DMs doesn't track streamMessageId, so resolvePreviewTarget() misses the preview on final delivery and sends a duplicate message. Extend the existing reasoning-lane message transport fix to all lanes in DMs.
Greptile SummaryThis PR fixes a duplicate-message bug in Telegram DM conversations when Root cause verified: The answer lane was using draft transport ( Fix verified: The implementation correctly removes the Test coverage verified: The test "uses message preview transport for all DM lanes when streaming is active" correctly verifies that both answer (call[0]) and reasoning (call[1]) lanes use No issues found. The implementation is minimal, focused, and correct. Confidence Score: 5/5
Last reviewed commit: e14a678 |
mdlmarkham
left a comment
There was a problem hiding this comment.
Review: Telegram DM Streaming Fix ✅
Verdict: Minimal fix with good test coverage. Ready to merge.
Problem
When channels.telegram.streaming: "partial" is set, DM conversations show duplicate messages:
- Streaming preview message
- Final delivery message
Root Cause
The answer lane in DMs was using sendMessageDraft (draft transport), which doesn't track streamMessageId. When final delivery arrives, resolvePreviewTarget() can't find the preview to edit, so it sends a new message instead.
The reasoning lane already had the fix (using message transport), but answer lane was missed.
The Fix
Remove the laneName === "reasoning" guard so all lanes use message transport in DMs:
// Before: only reasoning lane used message transport
if (laneName === "reasoning") {
// message transport
}
// After: all lanes use message transport in DMs
transport = "message"Test Coverage
- ✅ Test updated to verify both lanes use
"message"transport in DMs - ✅ All 139 test files pass (1150 tests)
Why Draft Transport Exists
Draft transport (sendMessageDraft) is for editing the same message repeatedly — useful for streaming updates in channels/groups. But in DMs:
- Message transport works the same way
- Streaming preview can be tracked and edited
- No duplication
Edge Cases
- Group chats: Still use draft transport (correct) — the fix is DM-only
- Multiple streaming lanes: Both reasoning and answer use message transport in DMs ✅
Recommendation: Approve. Fixes duplicate messages in Telegram DMs, minimal change.
|
Landed on a505be7 from source commit e14a678. What was done:
Thanks @gambletan for the fix. |
Landed from contributor PR #38906 by @gambletan. Co-authored-by: gambletan <ethanchang32@gmail.com>
Landed from contributor PR openclaw#38906 by @gambletan. Co-authored-by: gambletan <ethanchang32@gmail.com>
Landed from contributor PR openclaw#38906 by @gambletan. Co-authored-by: gambletan <ethanchang32@gmail.com>
Landed from contributor PR openclaw#38906 by @gambletan. Co-authored-by: gambletan <ethanchang32@gmail.com>
Summary
Fixes #33453
When
channels.telegram.streamingis set to"partial", Telegram DM conversations show duplicate messages — the streaming preview plus a separate final message.Root cause: The answer lane in DMs uses draft transport (
sendMessageDraft), which doesn't track astreamMessageId. When the final delivery arrives,resolvePreviewTarget()can't find the preview message to edit in place, sodeliverLaneTextfalls through tosendPayload()and sends a duplicate.The reasoning lane already had a fix for this, but the answer lane was still using draft transport.
Fix: Remove the
laneName === "reasoning"guard so all lanes use message transport in DMs.Test plan
"message"transport in DMs🤖 Generated with Claude Code