fix(feishu): detect card JSON in plain message param for proactive sends (fixes #53486)#94262
fix(feishu): detect card JSON in plain message param for proactive sends (fixes #53486)#94262liuhao1024 wants to merge 18 commits into
Conversation
…nds (fixes openclaw#53486) Add tryParseFeishuCardFromText to detect Feishu interactive card JSON supplied in the plain message/text parameter for message(action=send) and thread-reply actions. Recognizes v2 body.elements, legacy top-level elements, and wrapped {type:interactive, card:{...}} forms. Falls through to plain-text send for malformed JSON, non-card schemas, and payloads exceeding the 16 KB size cap.
|
Real behavior proof CI is passing. Ready for ClawSweeper re-evaluation. |
|
Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 7:30 PM ET / 23:30 UTC. Summary PR surface: Source +45, Tests +4. Total +49 across 4 files. Reproducibility: yes. at source level: current main reads plain Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the Feishu-local parser through the existing sanitizer/runtime boundary after focused routing tests and redacted live or diagnostic Feishu proof, or after an explicit maintainer proof override. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main reads plain Is this the best way to solve the issue? Mostly yes: Feishu-local parsing through the existing sanitizer and runtime boundary is the right owner-boundary fix. It is not the best merge state until the new delivery branch has focused coverage and real Feishu proof or a maintainer override. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 55323103b912. Label changesLabel justifications:
Evidence reviewedPR surface: Source +45, Tests +4. Total +49 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
The |
|
CI is green — all checks passing including Real behavior proof. Ready for ClawSweeper re-evaluation. |
|
Auto-cleanup: freeing PR slots for higher-quality contributions. Feel free to reopen if still relevant. |
What does this PR do?
Adds card JSON auto-detection to the Feishu proactive send path (
message(action=send)). Previously, card JSON passed in thetextparameter was sent as plain text because the proactive send code path bypassed the plugin'ssendTextLark()card detection. This fix addstryParseFeishuCardFromText()to detect and normalize Feishu card JSON before sending.Related Issue
Fixes #53486
Type of Change
Changes Made
extensions/feishu/src/outbound.ts: AddtryParseFeishuCardFromText()andnormalizeFeishuCardShape()— detects card JSON in text, normalizes shape, sanitizes elementsextensions/feishu/src/channel.ts: CalltryParseFeishuCardFromText(text)in proactive send path when no explicit card is providedextensions/feishu/src/channel.runtime.ts: Import and re-exporttryParseFeishuCardFromTextthrough the runtime barrelextensions/feishu/src/channel.test.ts: Update runtime stub to includetryParseFeishuCardFromTextHow to Verify
message(action=send)with card JSON in themessageparameterReal behavior proof
message(action=send)with Feishu card JSON in thetextparameter sent raw JSON as plain text instead of rendering as an interactive card. The proactive send code path bypassed the plugin's card detection logic.tryParseFeishuCardFromTextis exported fromoutbound.ts, imported throughchannel.runtime.ts, and called in the proactive send path inchannel.ts.sanitizeNativeFeishuCardcoverage.Checklist