diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index 5e7f3c6016e7..63f146f25d96 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -1023,6 +1023,9 @@ describe("buildAgentSystemPrompt", () => { expect(telegramPrompt).toContain("pull quotes"); expect(telegramPrompt).toContain('task lists via `` inside `
  • `'); expect(telegramPrompt).toContain("anchors/in-message links"); + expect(telegramPrompt).toContain( + "formulas (inline `LaTeX`, block `LaTeX`; not `$...$` or `\\(...\\)`)", + ); expect(telegramPrompt).toContain("maps/collages/slideshows"); expect(telegramPrompt).toContain("use `
    `, not legacy `
    `"); expect(telegramPrompt).toContain("use `
    • ...
    `, not literal bullet characters"); diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 6667120ba4f6..337dcc56cd6c 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -527,7 +527,7 @@ function buildMessagingSection(params: { : "- Reply in current session → automatically routes to the source channel (Signal, Telegram, etc.)", telegramRuntime ? telegramRichTextEnabled - ? '- Telegram rich text is available. Use Bot API 10.1 rich formatting in visible message text when it improves clarity: headings, tables with alignment/captions/spans, blockquotes, pull quotes, `
    ......
    `, dividers, `/`, ``, spoilers, `
      /
        ` lists with `
      1. ` items, task lists via `` inside `
      2. `, code blocks, footnotes/references, formulas, anchors/in-message links, custom emoji, maps/collages/slideshows, and standalone rich media blocks such as ``. This is not legacy MarkdownV2/parse_mode; OpenClaw renders Telegram-safe rich messages. For collapsible content, use `
        `, not legacy `
        `; for structured bullets, use `
        • ...
        `, not literal bullet characters. Media tags are blocks, not inline prose; use captions/credits when helpful; button labels are plain text only; send normal attachments through explicit media delivery.' + ? '- Telegram rich text is available. Use Bot API 10.1 rich formatting in visible message text when it improves clarity: headings, tables with alignment/captions/spans, blockquotes, pull quotes, `
        ......
        `, dividers, `/`, ``, spoilers, `
          /
            ` lists with `
          1. ` items, task lists via `` inside `
          2. `, code blocks, footnotes/references, formulas (inline `LaTeX`, block `LaTeX`; not `$...$` or `\\(...\\)`), anchors/in-message links, custom emoji, maps/collages/slideshows, and standalone rich media blocks such as ``. This is not legacy MarkdownV2/parse_mode; OpenClaw renders Telegram-safe rich messages. For collapsible content, use `
            `, not legacy `
            `; for structured bullets, use `
            • ...
            `, not literal bullet characters. Media tags are blocks, not inline prose; use captions/credits when helpful; button labels are plain text only; send normal attachments through explicit media delivery.' : "- Telegram rich messages are disabled for this bot/account. Do not claim Bot API 10.1 tables, details blocks, rich media, formulas, or other rich-message-only formatting are enabled. Standard Telegram HTML formatting is available; ask the owner to enable Telegram rich messages for this channel/account." : "", "- Cross-session messaging → use sessions_send(sessionKey, message)",