diff --git a/CHANGELOG.md b/CHANGELOG.md index 08695002af8..3762ecb84bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Telegram/streaming: sanitize tool-progress draft preview backticks before shared compaction, so long backtick-heavy progress text still renders inside the safe code-formatted preview instead of collapsing to an ellipsis. - Agents/Pi: suppress persistence for synthetic mid-turn overflow continuation prompts, so transcript-retry recovery does not write the "continue from transcript" prompt as a new user turn. Thanks @vincentkoc. - Telegram: keep reply-dispatch lazy provider runtime chunks behind stable dist names and delete `/reasoning stream` previews after final delivery so package updates and live reasoning drafts do not leave Telegram turns broken or noisy. Thanks @BunsDev. - Exec approvals: detect `env -S` split-string command-carrier risks when `-S`/`-s` is combined with other env short options, so approval explanations do not miss split payloads hidden behind `env -iS...`. Thanks @vincentkoc. diff --git a/extensions/telegram/src/bot-message-dispatch.ts b/extensions/telegram/src/bot-message-dispatch.ts index e5a83311db5..bc3933182dd 100644 --- a/extensions/telegram/src/bot-message-dispatch.ts +++ b/extensions/telegram/src/bot-message-dispatch.ts @@ -238,10 +238,13 @@ function clipProgressMarkdownText(text: string): string { return `${text.slice(0, MAX_PROGRESS_MARKDOWN_TEXT_CHARS - 1).trimEnd()}…`; } +function sanitizeProgressMarkdownText(text: string): string { + return text.replaceAll("`", "'"); +} + function formatProgressAsMarkdownCode(text: string): string { const clipped = clipProgressMarkdownText(text); - const safe = clipped.replaceAll("`", "'"); - return `\`${safe}\``; + return `\`${sanitizeProgressMarkdownText(clipped)}\``; } export const dispatchTelegramMessage = async ({ @@ -509,7 +512,7 @@ export const dispatchTelegramMessage = async ({ if (options?.toolName !== undefined && !isChannelProgressDraftWorkToolName(options.toolName)) { return; } - const normalized = line?.replace(/\s+/g, " ").trim(); + const normalized = sanitizeProgressMarkdownText(line?.replace(/\s+/g, " ").trim() ?? ""); if (streamMode !== "progress") { if (!previewToolProgressEnabled || previewToolProgressSuppressed || !normalized) { return;