Skip to content

fix(feishu): sanitize identity emoji in card headers - #96587

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
harjothkhara:oss/55242-feishu-identity-emoji-header
Jun 29, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
harjothkhara:oss/55242-feishu-identity-emoji-header

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #55242

What Problem This Solves

Fixes an issue where Feishu users would see prose from an agent's identity.emoji config rendered in card headers when long replies or interactive payloads used Feishu card format.

Why This Change Was Made

The fix keeps the behavior local to the Feishu plugin card-header boundary. Feishu card headers now derive their identity prefix through a shared grapheme-aware helper that strips descriptive prose while preserving valid emoji clusters, including flags, skin-tone modifiers, and ZWJ family emoji.

This replaces the raw identity.emoji interpolation in the outbound payload-card path, the outbound renderMode=card text path, and the reply-dispatcher streaming/static card path. The prior closed attempts, #92937 and #93589, were not reused because review found they split multi-codepoint emoji and added no focused regression tests.

User Impact

Feishu card headers now show a clean emoji/name title instead of leaking descriptive identity text. Existing valid emoji identities such as 🇺🇸, 👍🏽, and 👨‍👩‍👧‍👦 remain intact.

Evidence

AI-assisted: yes. I used Codex to implement and review this change and understand the resulting diff.

Behavior addressed: Feishu card headers displayed raw identity.emoji prose in outbound card, outbound text-card, and reply-dispatcher streaming/static card paths.

Real environment tested: local source checkout at commit 7eca53c409 on branch oss/55242-feishu-identity-emoji-header, using the Feishu plugin card-construction paths with mocked Feishu network sends.

Exact steps or command run after this patch:

  • node scripts/run-vitest.mjs extensions/feishu/src/outbound.test.ts extensions/feishu/src/reply-dispatcher.test.ts
  • git diff --check
  • /Users/harjothk/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3 .agents/skills/autoreview/scripts/autoreview --mode local --prompt "Review fix for #55242: Feishu card headers now sanitize descriptive identity.emoji text via a Feishu-local grapheme-aware helper, preserving flag/skin-tone/ZWJ emoji clusters across outbound payload cards, outbound renderMode cards, and reply-dispatcher streaming/static cards with focused regression tests."
  • /Users/harjothk/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3 .agents/skills/autoreview/scripts/autoreview --mode local --prompt "Review fix for #55242 after OpenGrep fixture-name adjustment: production code still sanitizes Feishu identity.emoji card headers with the grapheme-aware helper; tests now avoid using CC as a display-name literal because OpenGrep treats it as a dangerous env key."

Evidence after fix:

  • outbound.test.ts verifies renderMode=card headers strip descriptive prose while preserving 😊🇺🇸👍🏽👨‍👩‍👧‍👦.
  • outbound.test.ts verifies native interactive payload cards use the same sanitized identity header.
  • reply-dispatcher.test.ts verifies both streaming and static Feishu card headers use the sanitized identity header.

Observed result after fix: focused Feishu tests passed, git diff --check passed, and both autoreview runs reported autoreview clean: no accepted/actionable findings reported.

Visible payload proof (card-header title OpenClaw sends to Feishu)

Re-verified red-green on a clean checkout, capturing the constructed card-header payload — the exact title string our code emits. The bug and the fix both live in our payload construction (Feishu renders the title string verbatim), so this payload proof covers the reported behavior.

Identity input (the issue's example + the hard clusters): name: "Agent", emoji: "根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦".

Card-header title produced, per path:

Card path main (before — bug) this branch (after — fixed)
outbound renderMode card 根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent
outbound native payload card 根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent
reply-dispatcher streaming + static 根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent

Commands and results:

  • main: node scripts/run-vitest.mjs extensions/feishu/src/outbound.test.ts extensions/feishu/src/reply-dispatcher.test.ts -t "strips prose from identity emoji" → FAIL (Received "title": "根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent" — descriptive prose leaks into the header).
  • this branch: same command → PASS; full node scripts/run-vitest.mjs extensions/feishu → 72 files / 964 tests pass.

The descriptive prose is stripped while the flag (🇺🇸), skin-tone (👍🏽), and ZWJ-family (👨‍👩‍👧‍👦) clusters are preserved intact across all three card paths.

What was not tested: I did not run a live Feishu/Lark visual render with real credentials. Feishu renders the card-header title string verbatim, so the payload-level proof above covers the reported bug (raw identity.emoji interpolation in our card-header construction).

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: S labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 8:22 PM ET / 00:22 UTC.

Summary
The PR adds a Feishu-local identity header sanitizer and routes outbound payload cards, outbound render-mode cards, and reply-dispatcher card headers through it, with focused regression tests.

PR surface: Source +40, Tests +64. Total +104 across 5 files.

Reproducibility: yes. source-reproducible: current main directly concatenates raw identity.emoji into the Feishu card header paths, and the PR body provides red-green payload output for the affected title value. I did not run a live Feishu/Lark visual reproduction in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #55242
Summary: This PR is the active candidate fix for the canonical Feishu identity.emoji card-header bug; earlier same-scope PRs are closed unmerged.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Risk before merge

  • [P1] No live Feishu/Lark visual render was run in this read-only review; the merge confidence comes from source inspection and red-green payload proof for the exact card-header title string.

Maintainer options:

  1. Decide the mitigation before merge
    Land the Feishu-local sanitizer after ordinary maintainer merge review, keeping the fix scoped to card-title construction and the focused regression tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair lane is needed because the PR has no actionable review findings; maintainer review and merge judgment are the remaining actions.

Security
Cleared: No concrete security or supply-chain regression was found; the final diff only changes Feishu-local string filtering and tests.

Review details

Best possible solution:

Land the Feishu-local sanitizer after ordinary maintainer merge review, keeping the fix scoped to card-title construction and the focused regression tests.

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

Yes, source-reproducible: current main directly concatenates raw identity.emoji into the Feishu card header paths, and the PR body provides red-green payload output for the affected title value. I did not run a live Feishu/Lark visual reproduction in this read-only review.

Is this the best way to solve the issue?

Yes. A Feishu-local helper shared by outbound, payload-card, static reply, and streaming reply card headers is the narrow maintainable fix; no core identity, config, or plugin SDK surface change is needed.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded Feishu channel rendering bugfix with clear user-visible impact and limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes red-green visible payload output for the exact Feishu card-header title across the affected paths, which is sufficient for this payload-construction bug.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes red-green visible payload output for the exact Feishu card-header title across the affected paths, which is sufficient for this payload-construction bug.
Evidence reviewed

PR surface:

Source +40, Tests +64. Total +104 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 49 9 +40
Tests 2 64 0 +64
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 113 9 +104

What I checked:

Likely related people:

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

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 24, 2026
@harjothkhara

Copy link
Copy Markdown
Contributor Author

Added visible payload proof to the PR body (per ClawSweeper's accepted "visible payload/log proof" path for #55242).

Independently re-verified red-green on a clean checkout — the card-header title OpenClaw sends to Feishu now strips the descriptive identity.emoji prose while preserving the flag/skin-tone/ZWJ clusters, across all three card paths (outbound renderMode, outbound native payload, reply-dispatcher streaming + static):

  • main: regression fails — Received "title": "根据心情/语气自由切换 😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent" (prose leaks).
  • this branch: passes → "😊🇺🇸👍🏽👨‍👩‍👧‍👦 Agent"; full extensions/feishu suite green (72 files / 964 tests).

Feishu renders the header title verbatim, so this payload-level proof covers the reported bug (the leak is in our payload construction). Full before/after table is in the updated PR body. No live Feishu creds for a visual screenshot — flagging in case a maintainer wants to @clawsweeper re-review.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Jun 25, 2026
@vincentkoc
vincentkoc merged commit 31b531e into openclaw:main Jun 29, 2026
159 of 171 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 29, 2026
* fix(feishu): sanitize identity emoji in card headers

* test(feishu): avoid env-key identity header fixture
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
* fix(feishu): sanitize identity emoji in card headers

* test(feishu): avoid env-key identity header fixture
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 4, 2026
* fix(feishu): sanitize identity emoji in card headers

* test(feishu): avoid env-key identity header fixture

(cherry picked from commit 31b531e)
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 8, 2026
* fix(feishu): sanitize identity emoji in card headers

* test(feishu): avoid env-key identity header fixture

(cherry picked from commit 31b531e)
steipete added a commit that referenced this pull request Oct 15, 2026
Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. #89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve #96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from #40524.
- LINE cache eviction assumes ordinary wall-clock order. #132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 5269924/becd45325bc and 743d537 only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. f91ddef added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. #119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. #1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from #128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.
steipete added a commit that referenced this pull request Oct 15, 2026
…173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: #148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: #154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same #154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: #103695 predates #172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier #100123 TUI fixes remain, including their real #89059/#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: #159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: #121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base 9e3e16c and recorded main
a065e6a, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to #117143, with later work
  in #163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from #151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available #48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from #114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical #27189 defect belonged to the SDK replaced in #51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. #161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. #89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve #96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from #40524.
- LINE cache eviction assumes ordinary wall-clock order. #132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 5269924/becd45325bc and 743d537 only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. f91ddef added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. #119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. #1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from #128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…penclaw#173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: openclaw#148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: openclaw#154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same openclaw#154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: openclaw#103695 predates openclaw#172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier openclaw#100123 TUI fixes remain, including their real openclaw#89059/openclaw#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: openclaw#159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: openclaw#121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base d6898f3 and recorded main
51164a1, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to openclaw#117143, with later work
  in openclaw#163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from openclaw#151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available openclaw#48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from openclaw#114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical openclaw#27189 defect belonged to the SDK replaced in openclaw#51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. openclaw#161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. openclaw#89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve openclaw#96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from openclaw#40524.
- LINE cache eviction assumes ordinary wall-clock order. openclaw#132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 3bcf53d/233d19aff94 and 2bf2afc only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. 2512ef2 added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. openclaw#119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. openclaw#1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from openclaw#128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

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

3 participants