Repository navigation
fix(telegram): route channel direct messages replies to their topic - #120916
Conversation
Replies, previews, and media in channel Direct Messages topics now remain in their originating topic. Bot-private and forum topic routing remains unchanged.
|
Land-ready proof for exact head
Root cause: inbound channel Direct Messages topics were being collapsed into the bot-private/forum thread shape, so later delivery no longer knew which Telegram parameter owned the destination. The Telegram plugin now records the authoritative topic kind once and carries it through a canonical thread-parameter boundary and durable target encoding; unsupported channel-DM poll/typing operations fail before transport. Production delta is +205/-110 (net +95) across 19 files; tests are +525/-113 across 7 files. Bot-private and forum sibling routing remains on |
Follows #120916 by removing duplicate outbound preparation and transport harness code while preserving channel Direct Messages, forum, and bot-private routing.
|
Heads up: two Telegram dispatch tests have been failing on Reproduced on current Both trace to The second one is the convincing case for the new behavior being correct. Its own fixture sets So the fix looks like updating the two expectations to One reason it slipped quietly: the push run for the merge commit shows no failing checks because the extension lanes were skipped by change classification, so nothing surfaced this on Found while validating an unrelated Telegram PR against |
Replies, previews, and media in channel Direct Messages topics now remain in their originating topic. Bot-private and forum topic routing remains unchanged.
Follows openclaw#120916 by removing duplicate outbound preparation and transport harness code while preserving channel Direct Messages, forum, and bot-private routing.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users replying in a Telegram channel Direct Messages topic could receive previews, final messages, or media on the base or wrong topic because the distinct destination kind was lost.
Why This Change Was Made
This establishes the Direct Messages topic from authoritative inbound fields, encodes it through one Telegram-owned thread-parameter boundary, preserves it through durable
:direct-topic:<id>targets, keeps message-id edits topic-free, and rejects unsupported poll and typing operations before transport. Bot-private and forum topics continue usingmessage_thread_id.User Impact
Previews, final text, rich content, media, native-command and callback replies, and late or durable replies now remain in the originating channel Direct Messages topic.
Evidence
node scripts/run-vitest.mjs extensions/telegram/src/bot/helpers.test.ts extensions/telegram/src/thread-spec.test.ts extensions/telegram/src/bot-message-context.dm-threads.test.ts extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/reply-parameters.test.ts extensions/telegram/src/targets.test.ts extensions/telegram/src/transport-payload.test.ts extensions/telegram/src/bot-native-commands.test.ts extensions/telegram/src/send.test.tstsgotypechecks passed.oxfmt --check, andgit diff --checkpassed.AI-assisted: yes; implementation and final diff reviewed by Peter.