openclaw - ✅(Solved) Fix Feishu buildMarkdownCard generates incompatible card format (code: 230099) [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53771Fetched 2026-04-08 01:23:34
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×1

Error Message

The buildMarkdownCard function in send-Bz-uzZMi.js generates a card format that is incompatible with the current Feishu API, causing error code 230099 (parse card json err). 3. The message fails with error code 230099

Root Cause

The function generates this format:

{"schema":"2.0","config":{"wide_screen_mode":true},"body":{"elements":[{"tag":"markdown","content":text}]}}

This format has two issues:

  1. Extra body wrapper layer
  2. schema: "2.0" marker that is not recognized by the current API

PR fix notes

PR #53395: feishu: fix schema 2.0 card config in interactive card UX functions

Description (problem / solution / changelog)

Summary

Replace the legacy wide_screen_mode config field with schema 2.0 width_mode: "fill" in the remaining Feishu card builders used by interactive approval cards, quick-action launcher cards, and standard markdown/structured card sends.

Changes

  • createApprovalCard in extensions/feishu/src/card-ux-approval.ts: replace config: { wide_screen_mode: true } with config: { width_mode: "fill" }
  • createQuickActionLauncherCard in extensions/feishu/src/card-ux-launcher.ts: same replacement
  • buildMarkdownCard and buildStructuredCard in extensions/feishu/src/send.ts: same replacement for the normal Feishu card send paths
  • Tighten regression assertions in the touched Feishu tests so they verify width_mode: "fill" and explicitly reject legacy config keys on these schema 2.0 paths

Root Cause

Feishu card schema 2.0 does not support wide_screen_mode (a schema 1.x-only config field). When the bot sends these cards, Feishu can reject the payload with HTTP 400 error code 230099 parse card json err.

For these schema 2.0 cards, width_mode is the width control that preserves the intended wide-card rendering, while enable_forward is a separate forwarding option and is not a replacement for wide_screen_mode.

Testing

  • pnpm test -- extensions/feishu/src/card-ux-launcher.test.ts extensions/feishu/src/bot.card-action.test.ts extensions/feishu/src/monitor.bot-menu.test.ts extensions/feishu/src/send.test.ts
  • pnpm test -- extensions/feishu/src/send.reply-fallback.test.ts

Related

  • #53310
  • #53771

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/feishu/src/bot.card-action.test.ts (modified, +18/-0)
  • extensions/feishu/src/card-ux-approval.ts (modified, +1/-1)
  • extensions/feishu/src/card-ux-launcher.test.ts (modified, +26/-0)
  • extensions/feishu/src/card-ux-launcher.ts (modified, +1/-1)
  • extensions/feishu/src/monitor.bot-menu.test.ts (modified, +18/-0)
  • extensions/feishu/src/send.test.ts (modified, +31/-0)
  • extensions/feishu/src/send.ts (modified, +2/-2)

Code Example

{"schema":"2.0","config":{"wide_screen_mode":true},"body":{"elements":[{"tag":"markdown","content":text}]}}

---

{"config":{"wide_screen_mode":true},"elements":[{"tag":"markdown","content":"test"}]}

---

{"schema":"2.0","config":{"wide_screen_mode":true},"body":{"elements":[{"tag":"markdown","content":"test"}]}}
RAW_BUFFERClick to expand / collapse

Bug Description

The buildMarkdownCard function in send-Bz-uzZMi.js generates a card format that is incompatible with the current Feishu API, causing error code 230099 (parse card json err).

Root Cause

The function generates this format:

{"schema":"2.0","config":{"wide_screen_mode":true},"body":{"elements":[{"tag":"markdown","content":text}]}}

This format has two issues:

  1. Extra body wrapper layer
  2. schema: "2.0" marker that is not recognized by the current API

Expected vs Actual

Expected (working):

{"config":{"wide_screen_mode":true},"elements":[{"tag":"markdown","content":"test"}]}

Actual (broken):

{"schema":"2.0","config":{"wide_screen_mode":true},"body":{"elements":[{"tag":"markdown","content":"test"}]}}

Reproduction

  1. Configure Feishu channel in OpenClaw
  2. Send a message containing markdown code blocks or tables (triggers shouldUseCard)
  3. The message fails with error code 230099

Environment

  • OpenClaw: 2026.3.23-2
  • Feishu API: current

Suggested Fix

Modify buildMarkdownCard to remove the body wrapper and schema field, or verify the current Feishu card schema requirements.

extent analysis

Fix Plan

To resolve the issue, we need to modify the buildMarkdownCard function in send-Bz-uzZMi.js to generate a compatible card format. Here are the steps:

  • Remove the schema field and the extra body wrapper layer from the generated JSON.
  • Update the function to return the expected format:
{
  "config": {
    "wide_screen_mode": true
  },
  "elements": [
    {
      "tag": "markdown",
      "content": "text"
    }
  ]
}

Example code changes:

// Before
function buildMarkdownCard(text) {
  return {
    "schema": "2.0",
    "config": {
      "wide_screen_mode": true
    },
    "body": {
      "elements": [
        {
          "tag": "markdown",
          "content": text
        }
      ]
    }
  };
}

// After
function buildMarkdownCard(text) {
  return {
    "config": {
      "wide_screen_mode": true
    },
    "elements": [
      {
        "tag": "markdown",
        "content": text
      }
    ]
  };
}

Verification

To verify the fix, send a message containing markdown code blocks or tables and check that it is successfully delivered to the Feishu channel without error code 230099.

Extra Tips

  • Make sure to test the updated function with different types of markdown content to ensure compatibility.
  • Consider adding error handling to catch any potential issues with the Feishu API.
  • Review the Feishu API documentation to ensure that the updated card format meets the current requirements.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING