fix(feishu): avoid logging raw duplicate card-action tokens#104498
Conversation
Avoid writing the raw Feishu card-action callback token into duplicate callback diagnostics while preserving duplicate suppression behavior. Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 12:22 PM ET / 16:22 UTC. Summary PR surface: Source 0, Tests +17. Total +17 across 2 files. Reproducibility: yes. from source. Replaying the same valid callback token for one account within the dedupe window deterministically reaches the current-main branch that logs the raw token; the contributor also supplied convincing after-fix live replay proof. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Merge the diagnostic-only redaction with its regression test, retaining the existing account-scoped replay guard, retry lifecycle, callback routing, and synthetic event behavior. Do we have a high-confidence way to reproduce the issue? Yes from source. Replaying the same valid callback token for one account within the dedupe window deterministically reaches the current-main branch that logs the raw token; the contributor also supplied convincing after-fix live replay proof. Is this the best way to solve the issue? Yes. Removing only the token interpolation is the narrowest maintainable repair because operators retain the useful duplicate signal while all token-dependent callback behavior remains unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b769964e82ab. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +17. Total +17 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (6 earlier review cycles)
|
|
@clawsweeper re-review Updated the PR body with a BOM-free authored problem/evidence section and a redacted runtime-level duplicate callback transcript. Also reran focused Feishu validation locally; no code changes were needed. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated the PR body with live Feishu runtime proof: a real |
|
Merged via squash.
|
…#104498) * fix(feishu): avoid logging raw duplicate card-action tokens Avoid writing the raw Feishu card-action callback token into duplicate callback diagnostics while preserving duplicate suppression behavior. Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> * test(feishu): use neutral callback token fixture * test(feishu): mark callback fixture as placeholder --------- Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where duplicate Feishu card-action callbacks could write the raw provider callback token into runtime diagnostics when the same callback token was received again inside the account-scoped dedupe window.
The callback token is still used internally as the dedupe key, but the operator-facing duplicate diagnostic no longer echoes that raw provider value back into logs.
Why This Change Was Made
Duplicate card-action handling now keeps the existing replay suppression behavior while changing only the duplicate diagnostic text. A repeated callback still produces a useful operational signal, but the log line no longer contains provider callback token material.
This does not change Feishu webhook authentication, callback parsing, card-action dispatch, retry handling, synthetic message routing, or the dedupe key used internally.
User Impact
Operators can still see when duplicate Feishu card-action callbacks are skipped, without logs containing the raw callback token from the provider event.
AI-assisted.
Evidence
Live Feishu callback + duplicate replay transcript
Captured from a real Feishu workspace card click via
lark-cli event consume card.action.trigger --as bot --output-dir, then replayed through the current OpenClaw Feishu card-action handler twice with the same real provider callback token. Tenant identifiers and the callback token are redacted.The replay command used the Feishu extension Vitest config so the event enters
handleFeishuCardActionwith the same token, message id, chat id, operator id, action tag, and action value captured from Feishu. This proves the live callback token still suppresses duplicate dispatch while the duplicate diagnostic no longer logs the raw token.Local validation
pnpm exec vitest run --config test/vitest/vitest.extension-feishu.config.ts extensions/feishu/src/live-feishu-duplicate-replay.proof.test.ts --reporter=verbose- passed, live captured event replay proofnode scripts/run-vitest.mjs run extensions/feishu/src/bot.card-action.test.ts- passed, 23 testsnode scripts/run-vitest.mjs run extensions/feishu/src/bot.card-action.test.ts -t "does not log raw duplicate callback tokens"- passed, focused duplicate-token regressionrg -n -F -- 'skipping duplicate card action token ${event.token}' extensions/feishu/src- no matchesrg -n -F -- 'card action token ${' extensions/feishu/src- no matchesgit diff --check- passedRemote CI note
Most PR checks passed on the current head. The remaining
checks-node-compact-large-3failure is insrc/agents/session-write-lock.test.ts, outside the Feishu extension files changed by this PR. TheReal behavior proofcheck is passing on the latest body update.