-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
[Bug] markdown.tables config is ignored during Telegram outbound message chunking / streaming #85085
Copy link
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the Bug
When sending messages through the Telegram outbound adapter, if the parse mode is not explicitly
HTML(such as during streaming assistant updates or chunked progress text), the message text is split usingmarkdownToTelegramHtmlChunks(text, limit).However, in the compiled output (specifically
format-CqcuR36z.js/src/extensions/telegram/src/format.ts), themarkdownToTelegramHtmlChunksfunction does not accept or propagate anoptionsparameter tomarkdownToTelegramChunks. Consequently, the configuredtableMode(e.g.,"markdown.tables": "bullets") is completely ignored, and markdown tables are delivered to Telegram in their raw format (| --- |), which looks unrendered and messy.Additionally, the delivery orchestrator (
deliver.ts) and the reply payload sender (reply-payload.ts) do not supply the configuration context (cfgandaccountId) to the chunker function, preventing it from resolvingtableModeconfiguration for the channel.Steps to Reproduce
openclaw.json:Proposed Solution
Here is a hotfix that resolves this issue by propagating the configuration context and resolving the table mode in
chunkTelegramOutboundText.1. Accept options in
markdownToTelegramHtmlChunksModify
format-CqcuR36z.jsto acceptoptionsand forward them:2. Resolve
tableModeinchunkTelegramOutboundTextModify
channel-RqV6hPGF.js(or the Telegram outbound adapter file) to importresolveMarkdownTableModeand resolvetableModefrom the context:3. Propagate context down to chunkers
deliver-Cp6bjPd4.js(outbound message plan):Update
chunkTextForPlanandplanOutboundTextMessageUnitsto accept and passcfgandaccountIdto the chunker call:reply-payload-DP0q6t5P.js:Forward
cfgandaccountIdwhen calling the chunker function insendTextMediaPayload: