From b95158a17d4aa8abd7b40e985b9e7be24cd58a71 Mon Sep 17 00:00:00 2001 From: bigduu Date: Wed, 15 Jul 2026 16:30:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(feishu):=20nest=20card=20elements=20under?= =?UTF-8?q?=20body=20=E2=80=94=20schema=202.0=20rejects=20top-level=20elem?= =?UTF-8?q?ents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caught in the first real-device e2e (2026-07-15): the real API refuses build_card()'s output with 200621 'parse card json err: unknown property elements at path []' — schema-2.0 cards put elements under body; top-level elements is the v1 location. Verified live after the fix: inbound feishu message → agent run → interactive card reply renders in the chat. Claude-Session: https://claude.ai/code/session_014iw5PBsSzDFHus1GfkAK4y --- src/platforms/feishu/mod.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/platforms/feishu/mod.rs b/src/platforms/feishu/mod.rs index e313a18..d3b2a20 100644 --- a/src/platforms/feishu/mod.rs +++ b/src/platforms/feishu/mod.rs @@ -312,6 +312,12 @@ fn escape_feishu_markdown(text: &str) -> String { /// adapter's own choice: the plan pins ONLY the `behaviors`/`value.cb` /// shape, not the surrounding container, so this is the one place protocol /// shape was inferred rather than verified — flagged in the task report. +/// +/// Schema 2.0 nests `elements` under `body` — a TOP-LEVEL `elements` key is +/// the v1 location and the real API rejects it with +/// `200621 parse card json err: unknown property "elements" at path []` +/// (caught live in the 2026-07-15 real-device e2e; the wiremock tests can't +/// see this because they don't validate Feishu's card schema). fn build_card(text: &str, buttons: Option<&[Vec