Skip to content

fix(feishu): nest card elements under body — schema 2.0 rejects top-level elements - #3

Merged
bigduu merged 1 commit into
mainfrom
fix/feishu-card-schema2-body
Jul 15, 2026
Merged

fix(feishu): nest card elements under body — schema 2.0 rejects top-level elements#3
bigduu merged 1 commit into
mainfrom
fix/feishu-card-schema2-body

Conversation

@bigduu

@bigduu bigduu commented Jul 15, 2026

Copy link
Copy Markdown
Owner

First real-device Feishu e2e (epic bamboo#477 tail) caught this immediately: im/v1/messages refuses every card magpie sends with

code=230099 / ErrCode 200621: parse card json err —
unknown property: elements, path: []

build_card() emitted {"schema":"2.0", "config":…, "elements":[…]} — but schema 2.0 nests elements under body; a top-level elements is the v1 location. The code comment even flagged this exact spot as "protocol shape inferred rather than verified".

Fix: "body": {"elements": […]}. Same card JSON feeds both send and the PATCH edit path, so one change covers both.

Live-verified end-to-end after the fix: Feishu web → WS long-connection → allow_from → bridge → bamboo /v2 (device token) → agent run → streaming card reply ✅ MAGPIE-E2E-OK rendered in the chat. wiremock tests updated (content["body"]["elements"]); 45 feishu tests green.

https://claude.ai/code/session_014iw5PBsSzDFHus1GfkAK4y

…evel elements

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
@bigduu
bigduu merged commit ceae7de into main Jul 15, 2026
3 checks passed
@bigduu
bigduu deleted the fix/feishu-card-schema2-body branch July 15, 2026 08:41
bigduu added a commit to bigduu/Bamboo-agent that referenced this pull request Jul 15, 2026
…ts top-level elements (#484)

Same defect Magpie's first real-device e2e caught in its ported copy
(bigduu/Magpie#3): the real im/v1/messages API refuses the card with
200621 'parse card json err: unknown property elements at path []' —
schema-2.0 cards put elements under body; top-level is the v1 location.
Every in-proc feishu card send/edit fails until this lands. Fix verified
live against real Feishu via the identical magpie builder.

Claude-Session: https://claude.ai/code/session_014iw5PBsSzDFHus1GfkAK4y

Co-authored-by: bigduu <mugeng.du@gmail.com>
bigduu added a commit that referenced this pull request Jul 15, 2026
…rows out with column_set (#7)

Second real-API rejection the 2026-07-15 e2e caught (right after #3's
body-nesting fix): sending a card with a tag:"action" row fails with
200861 'cards of schema V2 no longer support this capability: unsupported
tag action'. Button rows are now a column_set with one weighted column per
button (buttons keep the pinned behaviors/value.cb shape). Live-verified:
the options-question card renders with working [OASIS]/[LAGOON] buttons.

Claude-Session: https://claude.ai/code/session_014iw5PBsSzDFHus1GfkAK4y

Co-authored-by: bigduu <mugeng.du@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant