Skip to content

[feature] feishu channel 支持 markdown-to-lark-card 富文本渲染 or auto-strip markdown #44

Description

@AmberCXX

现状

LLM agent(如 Claude Code)生成的回复内容默认富含 markdown 结构:## 标题、** 加粗、| 表格、- bullet 等。

当前飞书 channel(channels/feishu.ts)走文本消息模式发送,飞书客户端不解析 markdown,用户端看到大量原始符号(## 标题 / ** 加粗 / | 表格 |),阅读体验差。

format_hints 字段已声明"纯文本",但实际实现只是"字面纯文本发送",未做 markdown 处理(strip 或 render)。

对比:wechat channel(channels/wechat.ts)已实现 markdown auto-strip(format_hints 中标明"不支持 Markdown 会被自动 strip"),飞书 channel 无此处理。

期望行为

二选一(按可行性排序):

方案 A(推荐):飞书 channel 检测消息中的 markdown 语法,转换为飞书 rich_text 消息或 interactive card 发送——发挥飞书通道原生富文本能力。参考飞书文档 https://open.feishu.cn/document/

方案 B(次选):若富文本 render 复杂度高,至少与 wechat channel 一致 auto-strip markdown 符号返回纯文本。

复现步骤

  1. Agent 通过 hub_reply 发送含 markdown 内容到 feishu channel(如 ## Title\n\n**bold** text\n| a | b |\n|---|---|\n| 1 | 2 |
  2. 飞书客户端收到消息,看到原始 ##**| 符号

影响

  • 提升飞书通道消息可读性
  • 减少 agent 端手动适配 markdown 到纯文本的负担
  • 与 wechat channel 行为对齐

相关

  • channels/feishu.ts——feishu channel 实现
  • channels/wechat.ts——参考 wechat 已有 markdown strip 实现
  • format_hints 声明与实际行为一致性

环境

  • macOS 14.6.1(Darwin 23.6.0)
  • Bun 1.3.13
  • forge-hub 当前 HEAD 6441bb8merge: resolve conflict — keep SYNC_SKIP + EADDRINUSE detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions