openclaw - ✅(Solved) Fix [Bug]: `parseFeishuCardActionEventPayload` field name mismatch for v2 card callbacks [2 pull requests, 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#71670Fetched 2026-04-26 05:09:57
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2closed ×1commented ×1

Clicking any button on a Feishu Schema 2.0 interactive card is silently discarded. The card.action.trigger callback fires but the gateway drops it with ignoring malformed card action payload. Card buttons are completely non-functional.

Error Message

Every card button click is silently dropped. The parseFeishuCardActionEventPayload function returns null for all Schema 2.0 card callbacks, causing the handler to log an error and exit without processing the action.

Root Cause

Clicking any button on a Feishu Schema 2.0 interactive card is silently discarded. The card.action.trigger callback fires but the gateway drops it with ignoring malformed card action payload. Card buttons are completely non-functional.

Fix Action

Fixed

PR fix notes

PR #71692: fix(feishu): accept schema 2 card action context

Description (problem / solution / changelog)

Summary

  • Accept context.open_chat_id as the chat fallback for Feishu Schema 2.0 card-action callbacks.
  • Fall back to the operator IDs when v2 payloads omit context.open_id / context.user_id, preserving the existing internal event shape.
  • Add lifecycle regression coverage for a Schema 2.0 card callback that previously parsed as malformed.

Root Cause parseFeishuCardActionEventPayload only accepted legacy context.chat_id, context.open_id, and context.user_id fields. Schema 2.0 card callbacks provide open_chat_id context instead, so valid button clicks were dropped before dispatch.

Validation

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-feishu.config.ts extensions/feishu/src/monitor.lifecycle.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/feishu/src/monitor.account.ts extensions/feishu/src/monitor.card-action.lifecycle.test-support.ts
  • pnpm exec oxlint --tsconfig tsconfig.oxlint.extensions.json extensions/feishu/src/monitor.account.ts extensions/feishu/src/monitor.card-action.lifecycle.test-support.ts

Closes #71670

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/feishu/src/monitor.account.ts (modified, +3/-3)
  • extensions/feishu/src/monitor.card-action.lifecycle.test-support.ts (modified, +29/-0)

PR #71787: fix(feishu): accept schema 2 card callbacks

Description (problem / solution / changelog)

Summary

  • Problem: Feishu Schema 2.0 interactive card callbacks could be logged as malformed and dropped before dispatch.
  • Why it matters: Quick-action/approval card button clicks would silently do nothing for affected Feishu/Lark installs.
  • What changed: Normalize both legacy nested card-action payloads and Schema 2.0 callback shapes, including context.open_chat_id and nested operator.user_id.* identity objects.
  • What did NOT change (scope boundary): No outbound card schema, routing, permission, or command semantics changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #71670
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: The Feishu card-action parser required the older operator.open_id / context.chat_id style shape, while Schema 2.0 callbacks can provide operator identifiers inside operator.user_id.* and chat context as context.open_chat_id.
  • Missing detection / guardrail: Lifecycle coverage did not include a Schema 2.0 callback using the nested operator identity object and open_chat_id context.
  • Contributing context (if known): The SDK flattens event envelopes before dispatching to the card.action.trigger handler, so the parser needs to accept both callback payload variants at that boundary.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/feishu/src/monitor.card-action.lifecycle.test-support.ts
  • Scenario the test should lock in: a Schema 2.0 card-action callback with nested operator.user_id.{open_id,user_id,union_id} and context.open_chat_id routes to the reply dispatcher.
  • Why this is the smallest reliable guardrail: it exercises the real monitor handler boundary where the malformed callback was dropped.
  • Existing test that already covers this (if any): none.
  • If no new test is added, why not: N/A.

User-visible / Behavior Changes

Feishu/Lark Schema 2.0 card button clicks that previously no-op'd now dispatch normally.

Diagram (if applicable)

Before:
[Schema 2.0 card click] -> [parser expects legacy fields] -> [malformed/drop]

After:
[Schema 2.0 card click] -> [normalize callback shape] -> [dispatch reply]

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local Node/pnpm worktree
  • Model/provider: N/A
  • Integration/channel (if any): Feishu/Lark
  • Relevant config (redacted): N/A

Steps

  1. Register a card.action.trigger payload using Schema 2.0 callback fields with nested operator.user_id.* and context.open_chat_id.
  2. Include a valid OpenClaw Feishu card interaction envelope in action.value.
  3. Invoke the Feishu monitor card action handler.

Expected

  • The callback is accepted and routed to the Feishu reply dispatcher.

Actual

  • Before this fix, the callback was rejected as malformed before dispatch.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Local verification:

  • pnpm test extensions/feishu/src/monitor.lifecycle.test.ts
  • pnpm test extensions/feishu/src/bot.card-action.test.ts
  • pnpm check:changed
  • codex review --base origin/main (clean after addressing one schema-shape finding)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: targeted Feishu lifecycle/card-action tests and the changed-file validation gate pass locally.
  • Edge cases checked: legacy flat operator IDs still work; Schema 2.0 nested operator identity and open_chat_id context now work.
  • What you did not verify: live Feishu/Lark button click against a real tenant.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: Accepting more callback shapes could accidentally weaken malformed payload filtering.
    • Mitigation: The parser still requires a token, operator open ID, action tag, and record-valued action payload before constructing the synthetic event.

Changed files

  • extensions/feishu/src/card-action.ts (modified, +15/-9)
  • extensions/feishu/src/monitor.account.ts (modified, +38/-24)
  • extensions/feishu/src/monitor.card-action.lifecycle.test-support.ts (modified, +50/-0)

Code Example

parseFeishuCardActionEventPayload (monitor-DDkD5r4p.js ~L4089) requires context.chat_id, context.open_id, and context.user_id — all non-null — before accepting a payload. Feishu Schema 2.0 card callbacks send context.open_chat_id and context.open_message_id instead of context.chat_id. The strict null guard on L4090 returns null for every v2 card action, regardless of the actual payload content.
Suggested fix: read context.open_chat_id as fallback for context.chat_id, and fall back to operator.open_id / operator.user_id when context.open_id / context.user_id are absent.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Clicking any button on a Feishu Schema 2.0 interactive card is silently discarded. The card.action.trigger callback fires but the gateway drops it with ignoring malformed card action payload. Card buttons are completely non-functional.

Steps to reproduce

Configure OpenClaw with Feishu channel (WebSocket connection mode) Send a Schema 2.0 card with a callback button via the agent User clicks any button on the card Observe: gateway logs feishu[...]: ignoring malformed card action payload No response is sent to the user; nothing happens

Expected behavior

Clicking a card button triggers the configured action — the gateway processes the callback and the agent responds accordingly.

Actual behavior

Every card button click is silently dropped. The parseFeishuCardActionEventPayload function returns null for all Schema 2.0 card callbacks, causing the handler to log an error and exit without processing the action.

OpenClaw version

2026.4.21

Operating system

Ubuntu 22.04 / Linux 6.8.0

Install method

npm global

Model

N/A (issue occurs before agent is invoked)

Provider / routing chain

N/A

Additional provider/model setup details

No response

Logs, screenshots, and evidence

parseFeishuCardActionEventPayload (monitor-DDkD5r4p.js ~L4089) requires context.chat_id, context.open_id, and context.user_id — all non-null — before accepting a payload. Feishu Schema 2.0 card callbacks send context.open_chat_id and context.open_message_id instead of context.chat_id. The strict null guard on L4090 returns null for every v2 card action, regardless of the actual payload content.
Suggested fix: read context.open_chat_id as fallback for context.chat_id, and fall back to operator.open_id / operator.user_id when context.open_id / context.user_id are absent.

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Update the parseFeishuCardActionEventPayload function to use context.open_chat_id as a fallback for context.chat_id and operator.open_id/operator.user_id when context.open_id/context.user_id are absent.

Guidance

  • Review the parseFeishuCardActionEventPayload function in monitor-DDkD5r4p.js around line 4089 to understand the current null checks.
  • Modify the function to use context.open_chat_id as a fallback for context.chat_id when the latter is null or undefined.
  • Similarly, update the function to use operator.open_id and operator.user_id as fallbacks for context.open_id and context.user_id respectively when they are absent.
  • Verify that the updated function correctly processes Feishu Schema 2.0 card callbacks and triggers the expected actions.

Example

function parseFeishuCardActionEventPayload(context, operator) {
  const chatId = context.chat_id || context.open_chat_id;
  const openId = context.open_id || operator.open_id;
  const userId = context.user_id || operator.user_id;
  // Rest of the function remains the same
}

Notes

This fix assumes that context.open_chat_id and operator.open_id/operator.user_id contain the correct information for Feishu Schema 2.0 card callbacks. Additional testing may be necessary to ensure the updated function works as expected in all scenarios.

Recommendation

Apply the suggested workaround by updating the parseFeishuCardActionEventPayload function to use the fallback values as described. This should allow Feishu Schema 2.0 card buttons to function correctly.

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…

FAQ

Expected behavior

Clicking a card button triggers the configured action — the gateway processes the callback and the agent responds accordingly.

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 - ✅(Solved) Fix [Bug]: `parseFeishuCardActionEventPayload` field name mismatch for v2 card callbacks [2 pull requests, 1 comments, 2 participants]