feat(feishu): render markdown tables as Interactive Cards + fix CuaDriver backend cache - #45386
feat(feishu): render markdown tables as Interactive Cards + fix CuaDriver backend cache#45386x7peeps wants to merge 2 commits into
Conversation
…lain text Previously, when the agent produced a reply containing a markdown table, Feishu's 'post' content-type 'md' elements rendered the table as a blank message. The workaround was to fall back to msg_type='text', which discarded all formatting and made tables unreadable. Now the adapter detects markdown tables and renders them as Feishu Interactive Cards with native components (supported on Feishu v7.4+). The approach: - New splits content into text-only blocks and markdown table blocks, handling mixed content, multiple tables, and alignment specifiers. - New converts a parsed markdown table into Feishu's card table JSON with columns, rows, header styling, and page-size limits. - New assembles a complete Interactive Card payload combining markdown text elements and table elements. - now returns msg_type='interactive' with the card payload when tables are detected, instead of downgrading to plain text. - Both send_message and edit_message paths benefit from the change. Closes #...
When CuaDriverBackend fails to start on first attempt (e.g. missing 'mcp' binary), _backend was cached as not-None with a dead session. Subsequent _get_backend() calls returned the stale instance instead of re-creating it. Now checks _session._started before reusing the cache.
|
Duplicate of the saturated Feishu-table-rendering cluster (canonical #12114; tracked by #27469). At least 8+ open PRs implement the same markdown-table->Interactive-Card feature (#33180/#26429/#38453/#39045/#27046). Note: this PR also bundles an unrelated CuaDriver backend cache fix in tools/computer_use/tool.py. |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (high surface area)
This PR renders markdown tables as Interactive Cards in Feishu and fixes the CuaDriver backend cache. The diff is 533 additions with changes spanning Feishu platform adapter, CuaDriver backend, and table rendering logic.
The changes appear to be focused and additive, but the diff touches multiple areas: the Feishu platform adapter, a caching layer, and the table rendering pipeline. Without running tests to verify the Feishu card rendering and CuaDriver cache interaction, I cannot confidently APPROVE in cron mode. The large diff size (533 additions) warrants human review attention.
No security concerns, no debug artifacts, no secrets in the diff.
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved (high surface area — see notes)
Adds markdown table parsing and rendering as Feishu Interactive Cards. Also includes a CuaDriver backend cache fix.
Strengths:
- Clean regex-based table detection and parsing
- Handles escaped pipes in cell content
- Segments content into table and non-table blocks for mixed content
- Well-structured with dedicated helper functions
Notes:
- 533 additions touching 3 files
- A prior review (tonydwb) noted the high surface area — implementation is clean and well-scoped within the Feishu platform
No blocking issues found.
Reviewed by Hermes Agent
|
Closing as part of the saturated Feishu-table-rendering cluster (#12114 canonical). Thanks @alt-glitch. |
|
Closing as part of the saturated Feishu-table-rendering cluster. #12114 is the canonical PR for this feature. |
Summary
1. Feishu Markdown Table -> Interactive Card
Previously, when the agent produced a reply containing a markdown table, Feishu rendered it as a blank message via the post msg_type. Now detects markdown tables and renders them as Feishu Interactive Cards with native table components (supported on Feishu v7.4+).
2. CuaDriver Backend Cache Fix
When CuaDriverBackend failed to start on first attempt (e.g. missing mcp binary), _backend was cached as not-None with a dead session. Subsequent _get_backend() calls returned the stale instance instead of re-creating it. Now checks _session._started before reusing the cache.
Changes
Test Plan