fix(feishu): support reading WebSocket rendered card content - #4342
Conversation
Feishu cards arriving via WebSocket have a different structure than expected: elements are nested lists with tag:text/text fields instead of flat lists with tag:markdown/content. Also extract user_dsl for richer card data and support body.elements (schema 2.0).
Maintainer edit: parse Feishu card table columns and rows so forwarded table cards do not fall back to [interactive], and add parser regression coverage.
|
Pushed a maintainer fix for the Feishu card parser: table components now extract column headers and row values instead of falling back to |
Maintainer edit: remove speculative recursive cell handling and keep table extraction to the documented columns and row values.
|
@JiajunBernoulli 我做了一点改动,可以看看是不是符合你的预期💖 |
LGTM |
Re-bin
left a comment
There was a problem hiding this comment.
LGTM. This fixes a real Feishu card ingestion gap: WebSocket-rendered interactive cards now extract useful content from user_dsl, nested rendered text elements, schema 2.0 body elements, and table rows instead of falling back to [interactive].
I also checked the maintainer follow-up around table extraction, and the author confirmed the behavior matches expectations.
Validated locally:
- python -m pytest tests/channels/test_feishu_card_extraction.py tests/channels/test_feishu_login.py tests/channels/test_feishu_streaming.py -q
- python -m ruff check nanobot/channels/feishu.py tests/channels/test_feishu_card_extraction.py


Problem
Feishu cards arriving via WebSocket have a different structure than expected. The function returned empty results, causing cards to be displayed as placeholder.
Root Cause
Three structural mismatches between actual WebSocket card format and code expectations:
Fix
Three minimal changes to :
Testing
Verified with actual Feishu card messages - bot now correctly reads card content including markdown, tables, and structured data.