Skip to content

feat(feishu): render native tables using Interactive Card JSON 2.0 - #30928

Open
haojibb-beep wants to merge 1 commit into
NousResearch:mainfrom
haojibb-beep:feat/feishu-native-tables
Open

feat(feishu): render native tables using Interactive Card JSON 2.0#30928
haojibb-beep wants to merge 1 commit into
NousResearch:mainfrom
haojibb-beep:feat/feishu-native-tables

Conversation

@haojibb-beep

Copy link
Copy Markdown

Improve Feishu table rendering using Interactive Card JSON 2.0 component.

- Parse markdown tables from outbound messages.
- Convert to Feishu Interactive Card (JSON 2.0) with 'table' component.
- Supports native rendering with grey headers, rounded corners, and auto-width.
- Fallback to standard post/text if parsing fails.
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter labels May 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #12114 (canonical PR for Feishu markdown table → Card JSON 2.0 rendering). This is part of a very large cluster of competing PRs tracked at #27469.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pursuing native Feishu table rendering; current main still falls back to raw text for detected tables in plugins/platforms/feishu/adapter.py:4524-4534.

Problems

  • The PR targets gateway/platforms/feishu.py, but current main relocated the live adapter to plugins/platforms/feishu/adapter.py in 560010547. A salvage must port the change to that plugin surface.
  • The multi-table branch drops prose between tables. _parse_markdown_tables records each table's pre_text (gateway/platforms/feishu.py:173-194), but the builder emits only tables[0] before looping at gateway/platforms/feishu.py:272-275.
  • The PR contains no tests despite changing outbound message construction.

Suggested changes

  • Port the implementation to the current plugin adapter and model output as ordered text/table segments.
  • Emit each table's preceding text segment, then add regression tests for single, mixed, and multi-table content.

Automated hermes-sweeper review.

first_pre = tables[0]["pre_text"].strip()
if first_pre:
elements.append({"tag": "markdown", "content": first_pre})
for t in tables:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_parse_markdown_tables() stores pre_text for every table, but this branch emits only tables[0] before this loop. Any prose between table 1 and table 2 is therefore lost; emit each non-empty t["pre_text"] before its corresponding table.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants