fix(channels): use markdownToTelegramHtml for Telegram text formatting#1978
fix(channels): use markdownToTelegramHtml for Telegram text formatting#1978
Conversation
formatTextForPlatform() had no Telegram-specific branch, falling through to escapeHtml() which stripped all Markdown formatting. Added a telegram case that calls the existing markdownToTelegramHtml() function. Also fixed regex ordering in markdownToTelegramHtml() so code blocks are processed before inline code to prevent partial matches.
Code Review:fix(channels): use markdownToTelegramHtml for Telegram text formatting (#1978)变更概述本 PR 名义上修复 Telegram 消息格式化问题( 方案评估结论: Telegram 格式化修复本身正确且合理——增加 问题清单🟡 MEDIUM — 移除 think tag 过滤可能导致
|
| # | 严重级别 | 文件 | 问题 |
|---|---|---|---|
| 1 | 🟡 MEDIUM | AcpAgentManager.ts:447 |
移除 think tag 过滤,<think> 标签可能泄漏到 UI |
| 2 | 🟡 MEDIUM | AcpAgentManager.ts:815 |
残留的旧方法 JSDoc 片段 |
| 3 | 🔵 LOW | useAcpMessage.ts |
thought 状态已成死代码 |
| 4 | 🔵 LOW | ThinkTagDetector.ts:66 |
extractAndStripThinkTags 新增但未使用 |
结论
本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。
CONCLUSION: CONDITIONAL
IS_CRITICAL_PATH: false
PR_NUMBER: 1978
- Apply extractAndStripThinkTags before emitting content messages to UI, preventing <think> tag leakage from models like MiniMax - Remove residual JSDoc from deleted filterThinkTagsFromMessage method Review follow-up for #1978
PR Fix 验证报告原始 PR: #1978
总结: ✅ 已修复 2 个 | ❌ 未能修复 0 个
|
Summary
formatTextForPlatform()inActionExecutor.tshad no Telegram-specific branch, so it fell through toescapeHtml()which stripped all Markdown formatting (bold, italic, code, links)telegramcase that calls the existingmarkdownToTelegramHtml()function fromTelegramAdapter.tsmarkdownToTelegramHtml(): code blocks are now processed before inline code to prevent partial backtick matchesRelated Issues
Closes #1214
Test Plan
escapeHtmlandmarkdownToTelegramHtml(10 tests)