fix(feishu): support text tag and nested arrays in interactive card parsing#73203
fix(feishu): support text tag and nested arrays in interactive card parsing#73203taozengabc wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryAdds two additive improvements to Confidence Score: 5/5Safe to merge — changes are additive, correctly guarded, and well-tested. Both changes are minimal and additive: the No files require special attention. Reviews (1): Last reviewed commit: "fix(feishu): support text tag and nested..." | Re-trigger Greptile |
…arsing The parseInteractiveCardContent function only recognizes div, markdown, lark_md, and plain_text tags. Cards that use text tags (common in custom monitoring alert cards) or nested array layouts (table-like row structures [[cell1, cell2], ...]) fall through to the [Interactive Card] placeholder, losing all content. This affects quoted message context when users reply to card messages, causing the agent to lose critical context (e.g. alert details). Changes: - Add text tag support in extractInteractiveElementText - Flatten one level of nested arrays in extractInteractiveElementsText - Add test cases for both scenarios
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #73203 |
17a7abd to
bf6f954
Compare
|
Codex review: needs changes before merge. Summary Reproducibility: yes. A mocked Next step before merge Security Review findings
Review detailsBest possible solution: Keep the narrow Feishu-local Do we have a high-confidence way to reproduce the issue? Yes. A mocked Is this the best way to solve the issue? No, not yet. Direct Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a53be2d2ce8c. |
Problem
parseInteractiveCardContentonly recognizesdiv,markdown,lark_md, andplain_textelement tags. Two common card formats fall through to the[Interactive Card]placeholder:texttag elements — used by custom cards (e.g. monitoring alert cards built with CardKit):{ "tag": "text", "text": "Service health check failed" }Nested array layouts — table-like row structures common in monitoring/status cards:
{ "elements": [ [{"tag": "text", "text": "Service"}, {"tag": "text", "text": "eip-admin-api"}], [{"tag": "text", "text": "Alert"}, {"tag": "text", "text": "Health check failed 3 times"}] ] }This causes loss of context when users quote-reply to card messages — the agent receives
[Interactive Card]instead of the actual card content.Impact in production: 33 occurrences over 4 weeks in our Feishu deployment, primarily in SLA monitoring groups where users quote alert cards to ask the agent for analysis.
Fix
Two minimal changes in
extensions/feishu/src/send.ts:texttag support inextractInteractiveElementText— extractselement.textwhentag === "text"andtextis a stringextractInteractiveElementsText— when an element is itself an array (row of cells), iterate its children instead of skippingBoth changes are additive and do not affect existing parsing behavior for
div,markdown,lark_md, orplain_texttags.Tests
Added two test cases in
send.test.ts:texttag elements mixed withmarkdownelementsRelated