Skip to content

feat: make FEISHU_CARD_TABLE_LIMIT configurable via cardTableLimit#436

Open
Sway-Chan wants to merge 1 commit into
larksuite:mainfrom
Sway-Chan:fix/card-table-limit-configurable
Open

feat: make FEISHU_CARD_TABLE_LIMIT configurable via cardTableLimit#436
Sway-Chan wants to merge 1 commit into
larksuite:mainfrom
Sway-Chan:fix/card-table-limit-configurable

Conversation

@Sway-Chan
Copy link
Copy Markdown

Summary

Fixes #435

将 FEISHU_CARD_TABLE_LIMIT 从硬编码常量改为可配置项 channels.feishu.cardTableLimit。

Problem

Streaming Card 模式下,第 4 个 Markdown 表格起被 sanitizeTextForCard() 强制降级为代码块,而 Static 模式下同样内容正常渲染。原因是 FEISHU_CARD_LIMIT = 3 硬编码且无法通过配置调整。

Changes

  • src/card/card-error.ts:新增 resolveTableLimit(feishuCfg) 函数
  • src/card/reply-mode.ts:shouldUseCard() 新增可选 feishuCfg 参数
  • src/card/streaming-card-controller.ts:prepareTerminalCardContent() 新增可选 feishuCfg 参数
  • src/card/reply-dispatcher.ts:向 shouldUseCard() 传入 feishuCfg

Configuration

行为
不设置 3(缺省)
0 / false 关闭限制
正整数 自定义上限

- Add resolveTableLimit() to support channels.feishu.cardTableLimit config
- Default remains 3 (backward compatible)
- Set to 0/false to disable limit (Infinity)
- Set to any positive integer for custom limit
- Update shouldUseCard(), prepareTerminalCardContent() to read config
- Fixes Streaming Card mode degrading 4th+ tables to code blocks
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 22, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streaming Card 模式下 Markdown 表格超过 3 个后被降级为代码块,且 FEISHU_CARD_TABLE_LIMIT 不可配置

2 participants