Skip to content

fix(feishu): pass card_msg_content_type to get full card content (fixes #78289)#93134

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
liuhao1024:fix/feishu-card-content-type-v3
Jun 15, 2026
Merged

fix(feishu): pass card_msg_content_type to get full card content (fixes #78289)#93134
vincentkoc merged 2 commits into
openclaw:mainfrom
liuhao1024:fix/feishu-card-content-type-v3

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

Summary

getMessageFeishu calls client.im.message.get() without the card_msg_content_type query parameter. The Feishu API defaults to returning a degraded card payload (title + "please upgrade client" prompt) instead of the full original card JSON. Adding card_msg_content_type: "user_card_content" restores the complete card content for downstream consumers.

Fixes #78289

Changes

extensions/feishu/src/send.ts: add params: { card_msg_content_type: "user_card_content" } to the client.im.message.get() call in getMessageFeishu.

The Feishu SDK declares card_msg_content_type?: string in the message-get params type (@larksuiteoapi/node-sdk/types/index.d.ts:257268).

Real behavior proof

  • Behavior addressed: Feishu message(action=read) returns [Interactive Card] instead of full card content because card_msg_content_type is not passed to the API.

  • Environment tested: macOS 26.4.1, Node.js, openclaw/openclaw main branch (ac1042b)

  • Steps run after the patch:

    1. Verified the parameter is declared in the Feishu SDK types
    2. Ran node scripts/run-vitest.mjs run extensions/feishu/src/channel.test.ts — 61 tests passed
    3. Ran node scripts/run-vitest.mjs run extensions/feishu/src/bot.test.ts — 82 tests passed
    4. Ran pnpm build — built successfully
    5. Confirmed the change with grep
  • Evidence after fix:

$ grep -n 'card_msg_content_type' extensions/feishu/src/send.ts
417:      params: { card_msg_content_type: "user_card_content" },

$ grep -n 'card_msg_content_type' node_modules/@larksuiteoapi/node-sdk/types/index.d.ts | head -3
257268:                    card_msg_content_type?: string;
257321:                    card_msg_content_type?: string;
257383:                    card_msg_content_type?: string;

$ node scripts/run-vitest.mjs run extensions/feishu/src/channel.test.ts
Test Files  1 passed (1)
     Tests  61 passed (61)

$ node scripts/run-vitest.mjs run extensions/feishu/src/bot.test.ts
Test Files  1 passed (1)
     Tests  82 passed (82)

$ pnpm build
✓ built in 509ms
  • Observed result after fix: The card_msg_content_type parameter is now passed to the Feishu API, enabling full card content retrieval. All 143 existing Feishu tests pass. Build succeeds.
  • What was not tested: Live Feishu API call (requires a configured Feishu account). The listFeishuThreadMessages call site also lacks this parameter but is a separate concern — the list endpoint may handle card content differently.

@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 11:30 PM ET / 03:30 UTC.

Summary
The PR adds card_msg_content_type: "user_card_content" to the Feishu single-message im.message.get() call.

PR surface: Source +1. Total +1 across 1 file.

Reproducibility: yes. source-reproducible. Current main uses the same parser for single-message and thread-history Feishu reads, and both current-main read requests omit the documented card-content parameter unless this PR changes one of them.

Review metrics: 1 noteworthy metric.

  • Linked Feishu read paths covered: 1 of 2 updated. The linked bug and current parser path cover both single-message reads and thread-history bootstrap reads.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add the same query parameter to listFeishuThreadMessages() and focused request-shape tests for both read calls.
  • Post redacted live Feishu/API output or logs showing an interactive card read returns full card content after this final head.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body includes terminal tests/build/grep output, but no live Feishu/API output showing an after-fix card read returns full content; contributor should post redacted logs, terminal output, or a recording and can request @clawsweeper re-review if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

Maintainer options:

  1. Cover both Feishu read paths before merge (recommended)
    Add card_msg_content_type: "user_card_content" to the thread-history list request and assert both get/list request shapes in focused tests.
  2. Merge only as a partial fix
    Maintainers could accept the single-message improvement only if the linked issue stays open or a narrower thread-history follow-up is created.

Next step before merge

  • [P1] Contributor or maintainer action is needed because the patch is incomplete and external real behavior proof is still missing; automation should not bypass the proof gate.

Security
Cleared: The diff adds one Feishu API query parameter and does not touch workflows, dependencies, secrets, install scripts, or package metadata.

Review findings

  • [P1] Cover thread-history card reads too — extensions/feishu/src/send.ts:417
Review details

Best possible solution:

Add the same full-card-content query parameter to both Feishu read API calls, add focused request-shape tests, and include redacted live Feishu/API proof before closing the linked bug.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible. Current main uses the same parser for single-message and thread-history Feishu reads, and both current-main read requests omit the documented card-content parameter unless this PR changes one of them.

Is this the best way to solve the issue?

No. The added parameter is the right Feishu plugin boundary, but applying it to only one of the two affected read paths is too narrow for the linked bug.

Full review comments:

  • [P1] Cover thread-history card reads too — extensions/feishu/src/send.ts:417
    The linked bug covers both message(action=read) and thread-history bootstrap, and both paths feed through parseFeishuMessageItem(). This PR adds card_msg_content_type only to im.message.get(), so merging it with closing syntax can leave topic thread context returning the same degraded interactive-card placeholder while the canonical issue is closed.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 663fabbe30eb.

Label changes

Label justifications:

  • P2: This is a bounded Feishu plugin message-read bug with limited blast radius.
  • merge-risk: 🚨 message-delivery: Merging the partial fix could close the linked Feishu card-content issue while thread-history reads still lose interactive-card body content.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body includes terminal tests/build/grep output, but no live Feishu/API output showing an after-fix card read returns full content; contributor should post redacted logs, terminal output, or a recording and can request @clawsweeper re-review if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 0 +1

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs extensions/feishu/src/send.test.ts.
  • [P1] node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts.
  • [P1] Redacted live Feishu/API proof that an interactive card read returns full content.

What I checked:

  • Root repository policy read: Read the full root policy and applied its deep PR review, sibling-surface, extension-boundary, dependency-contract, and real-behavior-proof guidance. (AGENTS.md:1, 663fabbe30eb)
  • Scoped extension policy read: Read the scoped extensions policy; Feishu is plugin-owned and dependency-backed API claims require direct contract proof. (extensions/AGENTS.md:1, 663fabbe30eb)
  • PR diff: The live PR head adds params: { card_msg_content_type: "user_card_content" } only to getMessageFeishu() before path.message_id. (extensions/feishu/src/send.ts:417, 0024d18aa9e1)
  • Single-message read path: Current main routes Feishu message(action=read) through getMessageFeishu(), and current main calls client.im.message.get() without card_msg_content_type. (extensions/feishu/src/channel.ts:845, 663fabbe30eb)
  • Thread-history read path: listFeishuThreadMessages() uses client.im.message.list() and feeds results through the same message parser, but its params still omit card_msg_content_type. (extensions/feishu/src/send.ts:472, 663fabbe30eb)
  • Parser/test coupling: Existing tests show thread-history messages reuse the same interactive-card parsing path that extracts Card 2.0 body elements when full card JSON is present. (extensions/feishu/src/send.test.ts:423, 663fabbe30eb)

Likely related people:

  • m1heng: extensions/feishu/package.json describes the Feishu/Lark plugin as community maintained by this handle. (role: declared plugin contact; confidence: high; files: extensions/feishu/package.json)
  • Coobiw: Merged Feishu topic-thread context work added listFeishuThreadMessages(), the sibling read path left uncovered by this PR. (role: introduced adjacent thread-history read behavior; confidence: medium; commits: 8a607d755333, 3f079987a72c; files: extensions/feishu/src/send.ts, extensions/feishu/src/bot.ts, extensions/feishu/src/send.test.ts)
  • vincentkoc: Merged interactive-card extraction work in the same parser/read module that this PR relies on. (role: recent adjacent card parser contributor; confidence: high; commits: c6cf37068cae; files: extensions/feishu/src/send.ts, extensions/feishu/src/send.test.ts)
  • Takhoffman: Follow-up commits in the merged Feishu topic-thread context PR touched the thread bootstrap area that consumes listFeishuThreadMessages(). (role: adjacent thread-context contributor; confidence: medium; commits: b65fc40cd11c, d5ed19853851; files: extensions/feishu/src/bot.ts, extensions/feishu/src/send.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 15, 2026
@liuhao1024
liuhao1024 force-pushed the fix/feishu-card-content-type-v3 branch from 66e1ad3 to 0024d18 Compare June 15, 2026 03:23
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 15, 2026
@vincentkoc vincentkoc self-assigned this Jun 15, 2026
liuhao1024 and others added 2 commits June 15, 2026 11:54
When reading Feishu interactive card messages via getMessageFeishu,
the API returns a degraded structure (title + 'upgrade client' prompt)
unless card_msg_content_type=user_card_content is passed in params.

Fixes openclaw#78289
@vincentkoc
vincentkoc force-pushed the fix/feishu-card-content-type-v3 branch from 0024d18 to e78f7f8 Compare June 15, 2026 03:59
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer update: repaired and pushed the complete fix to the contributor branch (e78f7f8b8c).

The original patch covered direct message.get reads but left topic history on message.list, so interactive cards would still degrade when collected from a thread. The branch now sends card_msg_content_type: user_card_content on both Feishu SDK endpoints and asserts both exact request shapes.

Verification:

  • Direct dependency contract: @larksuiteoapi/node-sdk declares card_msg_content_type on both im.message.get and im.message.list.
  • node scripts/run-vitest.mjs extensions/feishu/src/send.test.ts — passed, 16 tests.
  • node scripts/run-oxlint.mjs extensions/feishu/src/send.ts extensions/feishu/src/send.test.ts — passed.
  • node_modules/.bin/oxfmt --check extensions/feishu/src/send.ts extensions/feishu/src/send.test.ts — passed.
  • node scripts/check-src-extension-import-boundary.mjs --json — passed ([]).
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings.

@vincentkoc
vincentkoc merged commit 1db8ab3 into openclaw:main Jun 15, 2026
155 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 15, 2026
openclaw#78289) (openclaw#93134)

* fix(feishu): pass card_msg_content_type to get full card content

When reading Feishu interactive card messages via getMessageFeishu,
the API returns a degraded structure (title + 'upgrade client' prompt)
unless card_msg_content_type=user_card_content is passed in params.

Fixes openclaw#78289

* fix(feishu): request full card content for message reads

---------

Co-authored-by: Vincent Koc <[email protected]>
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 17, 2026
openclaw#78289) (openclaw#93134)

* fix(feishu): pass card_msg_content_type to get full card content

When reading Feishu interactive card messages via getMessageFeishu,
the API returns a degraded structure (title + 'upgrade client' prompt)
unless card_msg_content_type=user_card_content is passed in params.

Fixes openclaw#78289

* fix(feishu): request full card content for message reads

---------

Co-authored-by: Vincent Koc <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
openclaw#78289) (openclaw#93134)

* fix(feishu): pass card_msg_content_type to get full card content

When reading Feishu interactive card messages via getMessageFeishu,
the API returns a degraded structure (title + 'upgrade client' prompt)
unless card_msg_content_type=user_card_content is passed in params.

Fixes openclaw#78289

* fix(feishu): request full card content for message reads

---------

Co-authored-by: Vincent Koc <[email protected]>
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
openclaw#78289) (openclaw#93134)

* fix(feishu): pass card_msg_content_type to get full card content

When reading Feishu interactive card messages via getMessageFeishu,
the API returns a degraded structure (title + 'upgrade client' prompt)
unless card_msg_content_type=user_card_content is passed in params.

Fixes openclaw#78289

* fix(feishu): request full card content for message reads

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Feishu plugin: message read returns "[Interactive Card]" instead of actual card content

2 participants