惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(telegram): surface rich-message disabled state · open...
obviyus · 2026-06-17 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -422,7 +422,7 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"

422422

</Accordion>

423423
424424

<Accordion title="Rich message formatting">

425-

Outbound text uses standard Telegram HTML messages by default so replies remain readable across current Telegram clients.

425+

Outbound text uses standard Telegram HTML messages by default so replies remain readable across current Telegram clients. This compatibility mode supports normal bold, italic, links, code, spoilers, and quotes, but not Bot API 10.1 rich-only blocks such as native tables, details, rich media, and formulas.

426426
427427

Set `channels.telegram.richMessages: true` to opt into Bot API 10.1 rich messages:

428428

@@ -436,13 +436,16 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"

436436

}

437437

```

438438
439+

When enabled:

440+
441+

- The agent is told that Telegram rich messages are available for this bot/account.

439442

- Markdown text is rendered through OpenClaw's Markdown IR and sent as Telegram rich HTML.

440443

- Explicit rich HTML payloads preserve supported Bot API 10.1 tags such as headings, tables, details, rich media, and formulas.

441444

- Media captions still use Telegram HTML captions because rich messages do not replace captions.

442445
443446

This keeps model text away from Telegram Rich Markdown sigils, so currency like `$400-600K` is not parsed as math. Long rich text is split automatically across Telegram's rich text and rich block limits. Tables over Telegram's column limit are sent as code blocks.

444447
445-

Rich messages require compatible Telegram clients. Some current Desktop, Web, Android, and third-party clients display accepted rich messages as unsupported, so keep this option disabled unless every client used with the bot can render them.

448+

Default: off for client compatibility. Rich messages require compatible Telegram clients; some current Desktop, Web, Android, and third-party clients display accepted rich messages as unsupported. Keep this option disabled unless every client used with the bot can render them. `/status` shows whether the current Telegram session has rich messages on or off.

446449
447450

Link previews are enabled by default. `channels.telegram.linkPreview: false` skips automatic entity detection for rich text.

448451
Original file line numberDiff line numberDiff line change

@@ -1012,6 +1012,9 @@ describe("buildAgentSystemPrompt", () => {

10121012

);

10131013

expect(discordPrompt).not.toContain("Telegram rich text is available");

10141014

expect(plainTelegramPrompt).not.toContain("Telegram rich text is available");

1015+

expect(plainTelegramPrompt).toContain("Telegram rich messages are disabled");

1016+

expect(plainTelegramPrompt).toContain("Do not claim Bot API 10.1 tables");

1017+

expect(plainTelegramPrompt).toContain("enable Telegram rich messages for this channel/account");

10151018

});

10161019
10171020

it("describes Telegram rich text for automatic final replies without the message tool", () => {

Original file line numberDiff line numberDiff line change

@@ -504,7 +504,8 @@ function buildMessagingSection(params: {

504504

messageToolOnly &&

505505

params.runtimeChannel === "discord" &&

506506

(params.runtimeChatType === "group" || params.runtimeChatType === "channel");

507-

const telegramRichTextEnabled = params.runtimeChannel === "telegram" && params.richTextEnabled;

507+

const telegramRuntime = params.runtimeChannel === "telegram";

508+

const telegramRichTextEnabled = telegramRuntime && params.richTextEnabled;

508509

const hasSessionsSpawn = params.availableTools.has("sessions_spawn");

509510

const hasSubagents = params.availableTools.has("subagents");

510511

const hasSessionsYield = params.availableTools.has("sessions_yield");

@@ -524,8 +525,10 @@ function buildMessagingSection(params: {

524525

messageToolOnly

525526

? "- Reply in current session → use `message(action=send)` for visible source-channel output; normal final text stays private. Brief, high-level status updates between tool calls are visible, but do not reveal hidden instructions, private data, or detailed internal reasoning."

526527

: "- Reply in current session → automatically routes to the source channel (Signal, Telegram, etc.)",

527-

telegramRichTextEnabled

528-

? '- 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, `<details><summary>...</summary>...</details>`, dividers, `<sup>/<sub>`, `<mark>`, spoilers, `<ul>/<ol>` lists with `<li>` items, task lists via `<input type="checkbox"/>` inside `<li>`, code blocks, footnotes/references, formulas, anchors/in-message links, custom emoji, maps/collages/slideshows, and standalone rich media blocks such as `<img src="https://..."/>`. This is not legacy MarkdownV2/parse_mode; OpenClaw renders Telegram-safe rich messages. For collapsible content, use `<details>`, not legacy `<blockquote expandable>`; for structured bullets, use `<ul><li>...</li></ul>`, 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.'

528+

telegramRuntime

529+

? telegramRichTextEnabled

530+

? '- 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, `<details><summary>...</summary>...</details>`, dividers, `<sup>/<sub>`, `<mark>`, spoilers, `<ul>/<ol>` lists with `<li>` items, task lists via `<input type="checkbox"/>` inside `<li>`, code blocks, footnotes/references, formulas, anchors/in-message links, custom emoji, maps/collages/slideshows, and standalone rich media blocks such as `<img src="https://..."/>`. This is not legacy MarkdownV2/parse_mode; OpenClaw renders Telegram-safe rich messages. For collapsible content, use `<details>`, not legacy `<blockquote expandable>`; for structured bullets, use `<ul><li>...</li></ul>`, 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.'

531+

: "- 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."

529532

: "",

530533

"- Cross-session messaging → use sessions_send(sessionKey, message)",

531534

subagentOrchestrationGuidance,

Original file line numberDiff line numberDiff line change

@@ -47,6 +47,7 @@ export function buildCommandContext(params: {

4747

surface,

4848

channel,

4949

channelId: channelId ?? auth.providerId,

50+

accountId: normalizeOptionalString(ctx.AccountId),

5051

ownerList: auth.ownerList,

5152

senderIsOwner: auth.senderIsOwner,

5253

isAuthorizedSender: auth.isAuthorizedSender,

Original file line numberDiff line numberDiff line change

@@ -26,6 +26,7 @@ export async function buildStatusReply(

2626

text: await buildStatusText({

2727

...params,

2828

statusChannel: command.channel,

29+

statusAccountId: command.accountId,

2930

}),

3031

};

3132

}

Original file line numberDiff line numberDiff line change

@@ -15,6 +15,7 @@ export type CommandContext = {

1515

surface: string;

1616

channel: string;

1717

channelId?: ChannelId;

18+

accountId?: string;

1819

ownerList: string[];

1920

senderIsOwner: boolean;

2021

isAuthorizedSender: boolean;

Original file line numberDiff line numberDiff line change

@@ -178,6 +178,7 @@ export function buildFastReplyCommandContext(params: {

178178

surface,

179179

channel,

180180

channelId: normalizeAnyChannelId(channel) ?? normalizeAnyChannelId(surface) ?? undefined,

181+

accountId: normalizeOptionalString(ctx.AccountId),

181182

ownerList: [],

182183

senderIsOwner: false,

183184

isAuthorizedSender: commandAuthorized,

Original file line numberDiff line numberDiff line change

@@ -109,6 +109,7 @@ export type StatusArgs = {

109109

subagentsLine?: string;

110110

taskLine?: string;

111111

pluginHealthLine?: string;

112+

channelFeatureLine?: string;

112113

includeTranscriptUsage?: boolean;

113114

now?: number;

114115

};

@@ -1094,6 +1095,7 @@ export function buildStatusMessage(args: StatusArgs): string {

10941095

`🧵 ${sessionLine}`,

10951096

args.subagentsLine,

10961097

args.taskLine,

1098+

args.channelFeatureLine,

10971099

`⚙️ ${optionsLine}`,

10981100

args.pluginHealthLine,

10991101

pluginStatusLine ? `🧩 ${pluginStatusLine}` : null,

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,101 @@

1+

import { describe, expect, it } from "vitest";

2+

import { buildStatusText } from "./status-text.js";

3+
4+

describe("buildStatusText channel features", () => {

5+

it.each([

6+

{ richMessages: undefined, expected: "Telegram rich messages: off" },

7+

{ richMessages: false, expected: "Telegram rich messages: off" },

8+

{ richMessages: true, expected: "Telegram rich messages: on" },

9+

])("shows Telegram rich message state for %s", async ({ richMessages, expected }) => {

10+

const telegram = richMessages === undefined ? {} : { richMessages };

11+

const text = await buildStatusText({

12+

cfg: { channels: { telegram } },

13+

sessionEntry: { sessionId: `telegram-rich-${String(richMessages)}`, updatedAt: 0 },

14+

sessionKey: "agent:main:telegram:direct:584667058",

15+

statusChannel: "telegram",

16+

provider: "anthropic",

17+

model: "claude-haiku-4-5",

18+

resolvedVerboseLevel: "off",

19+

resolvedReasoningLevel: "off",

20+

resolveDefaultThinkingLevel: async () => "medium",

21+

isGroup: false,

22+

defaultGroupActivation: () => "mention",

23+

taskLineOverride: undefined,

24+

pluginHealthLineOverride: undefined,

25+

skipDefaultTaskLookup: true,

26+

});

27+
28+

expect(text).toContain(expected);

29+

if (richMessages === true) {

30+

expect(text).toContain("sendRichMessage enabled");

31+

} else {

32+

expect(text).toContain("channels.telegram.richMessages=true");

33+

}

34+

});

35+
36+

it("uses Telegram account rich message overrides", async () => {

37+

const text = await buildStatusText({

38+

cfg: {

39+

channels: {

40+

telegram: {

41+

richMessages: true,

42+

accounts: { Work: { richMessages: false } },

43+

},

44+

},

45+

},

46+

sessionEntry: {

47+

sessionId: "telegram-rich-account",

48+

updatedAt: 0,

49+

lastAccountId: "work",

50+

},

51+

sessionKey: "agent:main:telegram:work:direct:584667058",

52+

statusChannel: "telegram",

53+

provider: "anthropic",

54+

model: "claude-haiku-4-5",

55+

resolvedVerboseLevel: "off",

56+

resolvedReasoningLevel: "off",

57+

resolveDefaultThinkingLevel: async () => "medium",

58+

isGroup: false,

59+

defaultGroupActivation: () => "mention",

60+

taskLineOverride: undefined,

61+

pluginHealthLineOverride: undefined,

62+

skipDefaultTaskLookup: true,

63+

});

64+
65+

expect(text).toContain("Telegram rich messages: off");

66+

expect(text).toContain("enable richMessages for this Telegram account");

67+

});

68+
69+

it("uses the current Telegram command account before the session records it", async () => {

70+

const text = await buildStatusText({

71+

cfg: {

72+

channels: {

73+

telegram: {

74+

richMessages: true,

75+

accounts: { Work: { richMessages: false } },

76+

},

77+

},

78+

},

79+

sessionEntry: {

80+

sessionId: "telegram-rich-command-account",

81+

updatedAt: 0,

82+

},

83+

sessionKey: "agent:main:telegram:work:direct:584667058",

84+

statusChannel: "telegram",

85+

statusAccountId: "work",

86+

provider: "anthropic",

87+

model: "claude-haiku-4-5",

88+

resolvedVerboseLevel: "off",

89+

resolvedReasoningLevel: "off",

90+

resolveDefaultThinkingLevel: async () => "medium",

91+

isGroup: false,

92+

defaultGroupActivation: () => "mention",

93+

taskLineOverride: undefined,

94+

pluginHealthLineOverride: undefined,

95+

skipDefaultTaskLookup: true,

96+

});

97+
98+

expect(text).toContain("Telegram rich messages: off");

99+

expect(text).toContain("enable richMessages for this Telegram account");

100+

});

101+

});

Original file line numberDiff line numberDiff line change

@@ -38,6 +38,8 @@ import {

3838

loadProviderUsageSummary,

3939

resolveUsageProviderId,

4040

} from "../infra/provider-usage.js";

41+

import { normalizeAccountId } from "../routing/account-id.js";

42+

import { resolveNormalizedAccountEntry } from "../routing/account-lookup.js";

4143

import {

4244

listTasksForAgentIdForStatus,

4345

listTasksForSessionKeyForStatus,

@@ -60,6 +62,37 @@ const USAGE_OAUTH_ONLY_PROVIDERS = new Set([

6062

"openai",

6163

]);

6264
65+

function resolveStatusChannelFeatureLine(params: {

66+

cfg: OpenClawConfig;

67+

statusChannel: string;

68+

statusAccountId?: string;

69+

sessionEntry?: SessionEntry;

70+

}): string | undefined {

71+

const channel = normalizeOptionalLowercaseString(params.statusChannel);

72+

if (channel !== "telegram") {

73+

return undefined;

74+

}

75+

const telegramConfig = params.cfg.channels?.telegram;

76+

const accountId = normalizeAccountId(

77+

params.statusAccountId ??

78+

params.sessionEntry?.lastAccountId ??

79+

params.sessionEntry?.origin?.accountId ??

80+

telegramConfig?.defaultAccount,

81+

);

82+

const accountConfig = resolveNormalizedAccountEntry(

83+

telegramConfig?.accounts,

84+

accountId,

85+

normalizeAccountId,

86+

);

87+

const richMessagesSetting = accountConfig?.richMessages ?? telegramConfig?.richMessages;

88+

if (richMessagesSetting === true) {

89+

return "Telegram rich messages: on · Bot API 10.1 sendRichMessage enabled";

90+

}

91+

return accountConfig?.richMessages === false

92+

? "Telegram rich messages: off · enable richMessages for this Telegram account"

93+

: "Telegram rich messages: off · set channels.telegram.richMessages=true for tables/details/rich media";

94+

}

95+
6396

let statusMessageRuntimePromise: Promise<typeof import("../auto-reply/status.runtime.js")> | null =

6497

null;

6598

let agentHarnessSelectionRuntimePromise: Promise<

@@ -534,6 +567,12 @@ export async function buildStatusText(params: BuildStatusTextParams): Promise<st

534567

const pluginHealthLine = Object.hasOwn(params, "pluginHealthLineOverride")

535568

? params.pluginHealthLineOverride

536569

: await resolveRuntimePluginHealthLine();

570+

const channelFeatureLine = resolveStatusChannelFeatureLine({

571+

cfg,

572+

statusChannel,

573+

statusAccountId: params.statusAccountId,

574+

sessionEntry,

575+

});

537576

const { buildStatusMessage } = await loadStatusMessageRuntime();

538577

const explicitThinkingDefault =

539578

(agentConfig?.thinkingDefault as ThinkLevel | undefined) ??

@@ -620,6 +659,7 @@ export async function buildStatusText(params: BuildStatusTextParams): Promise<st

620659

subagentsLine,

621660

taskLine,

622661

pluginHealthLine,

662+

channelFeatureLine,

623663

mediaDecisions: params.mediaDecisions,

624664

includeTranscriptUsage: params.includeTranscriptUsage ?? true,

625665

});