Skip to content

Cherry-pick batch: Telegram adapter (1/2) — 5 of 50 commits#2016

Merged
alexey-pelykh merged 8 commits intomainfrom
staging/cherry-pick-1920
Mar 27, 2026
Merged

Cherry-pick batch: Telegram adapter (1/2) — 5 of 50 commits#2016
alexey-pelykh merged 8 commits intomainfrom
staging/cherry-pick-1920

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Cherry-pick batch from upstream

Issue: #1920
Commits: 5 cherry-picked cleanly, 7 already on branch, 38 conflict (blocked by missing prerequisites)

Successfully picked

Hash Subject
988bd782f7 fix: restore Telegram topic announce delivery (openclaw#51688)
b12dc4d04d fix(telegram): update test expectations for allow_sending_without_reply
c11f95eced test(telegram): align webhook grammy mock
d264c761cb fix(telegram): add allow_sending_without_reply to prevent lost messages
e1ca5d9cc4 refactor(telegram-tests): share webhook settlement helper

Already on branch (7)

4e45a663e7, 6a8f5bc12f, 6b4c24c2e5, 8139f83175, 8b438a308b, a90c5092f2, ac5e97097e

Conflicts (38)

All 38 remaining commits conflict due to missing prerequisite cherry-picks in the telegram extension layer (extensions/telegram/src/). These files have diverged significantly between fork and upstream.

Adaptation

  • Fixed allow_sending_without_reply type error — grammy v1.41 types don't expose this deprecated Bot API property; used spread assertion.

Closes #1920

🤖 Generated with Claude Code

mvanhorn and others added 6 commits March 27, 2026 17:47
…@mvanhorn)

When `replyLike.text` or `replyLike.caption` is an unexpected
non-string value (edge case from some Telegram API responses),
the reply body was coerced to "[object Object]" via string
concatenation. Add a `typeof === "string"` guard to gracefully
fall back to empty string, matching the existing pattern used
for `quoteText` in the same function.

Co-authored-by: Penchan <[email protected]>
(cherry picked from commit 988bd78)
Update exact-match test assertions in send.test.ts to include the new
allow_sending_without_reply: true parameter. Tests using objectContaining
already pass, but several tests use exact object matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
(cherry picked from commit b12dc4d)
When a Telegram message that OpenClaw is replying to gets deleted before
delivery, the Telegram API rejects the entire sendMessage call with
"message to be replied not found". This causes the bot's response to be
silently lost and stuck in the failed delivery queue permanently.

Setting allow_sending_without_reply: true tells Telegram to deliver the
message as a standalone message if the reply target no longer exists,
instead of failing the entire request.

Applied to all 6 locations across 4 source files where
reply_to_message_id is set:
- send.ts: buildTelegramReplyParams (both reply_parameters and plain reply)
- bot/delivery.send.ts: buildTelegramSendParams
- draft-stream.ts: draft stream reply params
- bot-handlers.runtime.ts: error reply messages (file too large, media download failed)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
(cherry picked from commit d264c76)
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) March 27, 2026 16:51
@alexey-pelykh alexey-pelykh merged commit f848d08 into main Mar 27, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the staging/cherry-pick-1920 branch March 27, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cherry-pick (blocked): Telegram adapter (1/2) (50 commits)

5 participants