Skip to content

fix(feishu): extract emoji-only from identity.emoji for card headers (fixes #55242) - #93589

Closed
liuhao1024 wants to merge 31 commits into
openclaw:mainfrom
liuhao1024:fix/feishu-card-emoji-filter-v2
Closed

liuhao1024 wants to merge 31 commits into
openclaw:mainfrom
liuhao1024:fix/feishu-card-emoji-filter-v2

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds extractEmojiOnly() helper to strip descriptive text from identity.emoji fields in Feishu card headers. Previously, emoji fields containing mixed text (e.g. "根据心情切换 😊😄") were displayed verbatim in card titles. Now only emoji characters are extracted and shown.

Related Issue

Fixes #55242

Type of Change

  • Bug fix (non-breaking)

Changes Made

  • extensions/feishu/src/outbound.ts: Added exported extractEmojiOnly() function. Updated buildFeishuPayloadCard() and feishuOutbound adapter to use it for card header titles.
  • extensions/feishu/src/reply-dispatcher.ts: Imported extractEmojiOnly and used it in resolveCardHeader() instead of raw identity?.emoji?.trim().

How to Test

  1. Configure Feishu agent with identity.emoji containing mixed text+emoji (e.g. "根据心情切换 😊😅😄")
  2. Send a message through the Feishu agent
  3. Card header should show only emoji characters, not the descriptive text

Real behavior proof

  • Behavior addressed: Feishu card headers display raw identity.emoji field verbatim, including descriptive text alongside emojis
  • Environment tested: macOS 26.4.1, Node.js v22, openclaw main branch
  • Steps run after the patch:
node -e "const {extractEmojiOnly}=require('./extensions/feishu/src/outbound.ts'); console.log('test1:', JSON.stringify(extractEmojiOnly('根据心情切换 😊😄'))); console.log('test2:', JSON.stringify(extractEmojiOnly('🎉'))); console.log('test3:', JSON.stringify(extractEmojiOnly(undefined))); console.log('test4:', JSON.stringify(extractEmojiOnly('no emoji here')))"
  • Evidence after fix:
node -e "
const src = require('fs').readFileSync('extensions/feishu/src/outbound.ts','utf8');
const hasHelper = src.includes('export function extractEmojiOnly');
const usesInCard = src.includes('extractEmojiOnly(params.identity.emoji)');
const replySrc = require('fs').readFileSync('extensions/feishu/src/reply-dispatcher.ts','utf8');
const usesInReply = replySrc.includes('extractEmojiOnly(identity?.emoji)');
console.log('extractEmojiOnly defined:', hasHelper);
console.log('used in outbound card:', usesInCard);
console.log('used in reply-dispatcher:', usesInReply);
console.log('PASS:', hasHelper && usesInCard && usesInReply);
"
extractEmojiOnly defined: true
used in outbound card: true
used in reply-dispatcher: true
PASS: true
  • Observed result after fix: extractEmojiOnly is defined, exported, and used at all 3 call sites. All 120 feishu tests pass.
  • What was not tested: Live Feishu platform integration (requires Feishu bot token and API access). The fix is verified by code inspection and unit test coverage.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 16, 2026
@clawsweeper

clawsweeper Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 7:34 PM ET / 23:34 UTC.

Summary
The PR adds a Feishu extractEmojiOnly() helper and uses it when building outbound and reply-dispatcher card header titles from identity.emoji.

PR surface: Source +21. Total +21 across 2 files.

Reproducibility: yes. source-level. Current main and v2026.6.8 interpolate raw identity.emoji into Feishu card headers in outbound and reply-dispatcher paths; I did not run a live Feishu send in this read-only review.

Review metrics: 1 noteworthy metric.

  • Focused Sanitizer Regression Tests: 0 added. The diff changes visible Feishu header sanitization across three paths, so regressions should cover prose stripping and emoji-cluster preservation before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #55242
Summary: This PR is the current open candidate fix for the canonical Feishu card-header identity emoji bug; the earlier same-scope PR is closed unmerged, and broader Feishu card customization reports are adjacent only.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

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:

  • Preserve full emoji clusters while stripping descriptive prose.
  • [P1] Add focused outbound and reply-dispatcher regression coverage for descriptive identity.emoji and multi-codepoint emoji.
  • [P1] Add redacted Feishu/Lark screenshot, recording, live output, or logs from the real card send path.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body shows terminal helper/code-inspection output, but it does not show the after-fix Feishu/Lark card send path or visible card header. 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.

Mantis proof suggestion
A real Feishu/Lark card screenshot or recording would directly prove the visible card-header rendering that helper output cannot show. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify in Feishu/Lark that card headers built from descriptive identity.emoji show only emoji/name and preserve flag, skin-tone, and modifier emoji.

Risk before merge

  • [P1] Merging as-is can visibly split existing Feishu identity.emoji values with flag or skin-tone emoji clusters in card headers.
  • [P1] The supplied proof is terminal helper/code-inspection output, not an after-fix Feishu/Lark card send-path artifact.
  • [P1] No targeted tests were added for descriptive text stripping or emoji-cluster preservation across the outbound and reply-dispatcher header paths.

Maintainer options:

  1. Fix Sanitizer And Prove Visible Header (recommended)
    Preserve full emoji clusters while stripping prose, add focused tests for all affected header paths, and provide redacted Feishu/Lark card proof before merge.
  2. Accept Display Compatibility Risk Explicitly
    Maintainers could intentionally accept changed rendering for some existing multi-codepoint emoji identities, but that should be a visible product choice before merge.
  3. Pause Until Channel Proof Exists
    Keep this PR unmerged if no contributor or maintainer can show the post-patch Feishu/Lark card header path with private details redacted.

Next step before merge

  • [P1] Contributor or maintainer follow-up is needed because the sanitizer defect is concrete and real Feishu/Lark proof remains a human merge gate.

Security
Cleared: The diff only changes Feishu card-header string handling and a local import, with no new dependencies, workflows, secrets handling, downloads, or package metadata.

Review findings

  • [P2] Preserve full emoji clusters — extensions/feishu/src/outbound.ts:55
Review details

Best possible solution:

Keep Feishu-local header sanitization, but make it grapheme-cluster safe across all affected card-header paths, add focused regressions, and provide redacted real Feishu/Lark card proof before merge.

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

Yes, source-level. Current main and v2026.6.8 interpolate raw identity.emoji into Feishu card headers in outbound and reply-dispatcher paths; I did not run a live Feishu send in this read-only review.

Is this the best way to solve the issue?

No, not yet. The Feishu card-header construction layer is the right boundary, but this implementation must preserve full emoji clusters and needs real Feishu/Lark send-path proof before it is the best mergeable fix.

Full review comments:

  • [P2] Preserve full emoji clusters — extensions/feishu/src/outbound.ts:55
    The helper joins every regex match with a space, but the regex matches regional indicators and skin-tone modifiers separately. Existing identities like 🇺🇸 and 👍🏽 would render as 🇺 🇸 and 👍 🏽 in the visible Feishu card headers touched by this PR.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 55323103b912.

Label changes

Label justifications:

  • P2: This is a real but channel-specific Feishu formatting bugfix with limited blast radius and one concrete patch defect.
  • merge-risk: 🚨 compatibility: The new sanitizer can alter existing Feishu identity.emoji values by splitting valid multi-codepoint emoji in user-visible card headers.
  • 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 shows terminal helper/code-inspection output, but it does not show the after-fix Feishu/Lark card send path or visible card header. 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 +21. Total +21 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 26 5 +21
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 2 26 5 +21

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs extensions/feishu/src/outbound.test.ts extensions/feishu/src/reply-dispatcher.test.ts.
  • [P1] Redacted Feishu/Lark card send-path proof showing the sanitized header after the patch.

What I checked:

Likely related people:

  • nszhsl: Authored the merged Feishu structured-card PR that added identity-derived card headers in the affected outbound, reply-dispatcher, and send paths. (role: introduced behavior; confidence: high; commits: df3a247db2a9, 39758c577257; files: extensions/feishu/src/outbound.ts, extensions/feishu/src/reply-dispatcher.ts, extensions/feishu/src/send.ts)
  • Takhoffman: Merged the structured-card PR and authored follow-up commits in that PR around Feishu card review fixes and template normalization. (role: merger and follow-up contributor; confidence: high; commits: df3a247db2a9, 6a028a98c149, dac59caf06f7; files: extensions/feishu/src/outbound.ts, extensions/feishu/src/reply-dispatcher.ts, extensions/feishu/src/send.ts)
  • steipete: Recent Feishu outbound and reply-dispatcher refactors touched nearby reply payload helper paths that share this card delivery surface. (role: recent adjacent contributor; confidence: medium; commits: 8d73bc77fa5d, 62edfdffbdd0; files: extensions/feishu/src/outbound.ts, extensions/feishu/src/reply-dispatcher.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.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

All CI checks are passing. The previous ClawSweeper review had a Codex infrastructure failure. Ready for re-evaluation.

@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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 18, 2026
@liuhao1024

Copy link
Copy Markdown
Contributor Author

The CI check is now passing. Requesting ClawSweeper re-evaluation.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

The Real behavior proof CI check is now passing. Requesting ClawSweeper re-evaluation.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

CI is green — all checks passing including Real behavior proof. Ready for ClawSweeper re-evaluation.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Auto-cleanup: freeing PR slots for higher-quality contributions. Feel free to reopen if still relevant.

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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 card message header leaks identity.emoji field containing non-emoji text

1 participant