openclaw - 💡(How to fix) Fix [Bug] Feishu: card and image cannot be sent together (schema conflict) [1 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#54432Fetched 2026-04-08 01:27:37
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

Error Message

message(action=send, channel=feishu, media=/path/to/image.png) // → Schema validation error: "card: must have required property card"

Code Example

Validation failed for tool "message":
  - card: must have required property card

---

message(action=send, channel=feishu, media=/path/to/image.png)
// → Schema validation error: "card: must have required property card"
RAW_BUFFERClick to expand / collapse

Description Feishu send action cannot send images via the message tool due to a schema vs API conflict.

Problem

  • OpenClaw schema requires card as a mandatory parameter for the Feishu send action
  • Feishu API itself does NOT allow card and media (image) in the same request — they are mutually exclusive
  • Code at line 608 correctly checks for this: if (card && mediaUrl) throw new Error(...)
  • BUT the JSON Schema validation fires BEFORE the code runs, throwing: "card: must have required property 'card'"

Result When trying to send an image via Feishu (action=send, channel=feishu, media=...), the tool call fails with schema validation error, even when card is an empty object {}.

Error message

Validation failed for tool "message":
  - card: must have required property card

Code location

  • Schema definition: channel-1opGQxxp.js line 345, createMessageToolCardSchema() returns Type.Object({})
  • Send action handler: channel-1opGQxxp.js lines 606-608
  • Throws correctly when both card+media present, but schema validation fails first

Suggested fix Make card an optional parameter (not required) in the Feishu message tool schema, OR create a separate action for card-only sends vs media sends.

Reproduction

message(action=send, channel=feishu, media=/path/to/image.png)
// → Schema validation error: "card: must have required property card"

extent analysis

Fix Plan

To resolve the conflict between the OpenClaw schema and the Feishu API, we will make the card parameter optional in the Feishu message tool schema. This allows for both card-only and media-only sends without violating the schema validation.

Steps to Fix

  1. Update the schema definition: In channel-1opGQxxp.js, modify the createMessageToolCardSchema() function to make card optional.
  2. Adjust the schema: Change the schema definition from Type.Object({ card: Type.Required({ type: 'object' }) }) to Type.Object({ card: { type: 'object', required: false } }).
  3. Example Code:
// Before
const messageToolCardSchema = Type.Object({
  card: Type.Required({ type: 'object' }),
});

// After
const messageToolCardSchema = Type.Object({
  card: { type: 'object', required: false },
});
  1. Verify the fix: Test sending an image via Feishu using the message tool with action=send, channel=feishu, and media=/path/to/image.png to ensure the schema validation error is resolved.

Verification

Run the following command to verify the fix:

message(action=send, channel=feishu, media=/path/to/image.png)

If the image is sent successfully without any schema validation errors, the fix is applied correctly.

Extra Tips

  • Consider creating separate actions for card-only and media-only sends to avoid potential conflicts in the future.
  • Review the Feishu API documentation to ensure compliance with their requirements for sending messages with cards and media.

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

openclaw - 💡(How to fix) Fix [Bug] Feishu: card and image cannot be sent together (schema conflict) [1 comments, 2 participants]