fix(telegram): honor table mode in outbound chunks (#85455) · openclaw/openclaw@7fc691a
steipete
·
2026-05-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -49,6 +49,7 @@ Docs: https://docs.openclaw.ai
|
49 | 49 | - Skills: treat `openclaw.os: macos` as Darwin when checking skill requirements, so macOS-only skills no longer report as missing on macOS hosts. Fixes #61338. Thanks @Jessecq1995. |
50 | 50 | - Control UI/logs: strip ANSI escape sequences from displayed Gateway log messages so color codes no longer appear as raw text. Fixes #64399. Thanks @guguangxin-eng. |
51 | 51 | - Docker: pre-create the workspace and auth-profile config mount points with `node` ownership so first-run named volumes do not start root-owned. Fixes #85076. Thanks @Noerr. |
| 52 | +- Telegram: pass configured markdown table mode through outbound markdown chunking so chunked sends render tables consistently. Fixes #85085. Thanks @ShuaiHui. |
52 | 53 | - CLI/update: preserve managed Gateway service environment during package cutovers so macOS LaunchAgent repair/restart reads the pre-update service state instead of caller shell state. (#83026) |
53 | 54 | - Agents/providers: honor per-model `api` and `baseUrl` overrides in custom provider auth hooks and transport selection. Fixes #80487. (#80488) Thanks @huveewomg. |
54 | 55 | - Gateway/restart: eager-load the lifecycle runtime before in-place upgrade signal handling so package replacement does not deadlock restart imports. (#84890) Thanks @myps6415. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -773,6 +773,10 @@ export function markdownToTelegramChunks(
|
773 | 773 | return renderTelegramChunksWithinHtmlLimit(ir, limit); |
774 | 774 | } |
775 | 775 | |
776 | | -export function markdownToTelegramHtmlChunks(markdown: string, limit: number): string[] { |
777 | | -return markdownToTelegramChunks(markdown, limit).map((chunk) => chunk.html); |
| 776 | +export function markdownToTelegramHtmlChunks( |
| 777 | +markdown: string, |
| 778 | +limit: number, |
| 779 | +options: { tableMode?: MarkdownTableMode } = {}, |
| 780 | +): string[] { |
| 781 | +return markdownToTelegramChunks(markdown, limit, options).map((chunk) => chunk.html); |
778 | 782 | } |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,7 @@ function chunkTelegramOutboundText(
|
53 | 53 | ): string[] { |
54 | 54 | return ctx?.formatting?.parseMode === "HTML" |
55 | 55 | ? splitTelegramHtmlChunks(text, limit) |
56 | | - : markdownToTelegramHtmlChunks(text, limit); |
| 56 | + : markdownToTelegramHtmlChunks(text, limit, { tableMode: ctx?.formatting?.tableMode }); |
57 | 57 | } |
58 | 58 | |
59 | 59 | async function resolveTelegramSendContext(params: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,4 +29,16 @@ describe("telegramPlugin outbound", () => {
|
29 | 29 | markdownToTelegramHtmlChunks(text, 4000), |
30 | 30 | ); |
31 | 31 | }); |
| 32 | + |
| 33 | +it("passes markdown table mode to the outbound markdown chunker", () => { |
| 34 | +clearTelegramRuntime(); |
| 35 | +const text = ["| Name | Value |", "|------|-------|", "| A | 1 |"].join("\n"); |
| 36 | + |
| 37 | +const chunks = telegramOutbound.chunker?.(text, 4000, { |
| 38 | +formatting: { tableMode: "bullets" }, |
| 39 | +}); |
| 40 | + |
| 41 | +expect(chunks?.join("\n")).toContain("Value: 1"); |
| 42 | +expect(chunks?.join("\n")).not.toContain("| Name | Value |"); |
| 43 | +}); |
32 | 44 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。