Skip to content

fix(feishu): avoid logging raw duplicate card-action tokens#104498

Merged
steipete merged 4 commits into
openclaw:mainfrom
VectorPeak:fix/feishu-redact-duplicate-card-token
Jul 11, 2026
Merged

fix(feishu): avoid logging raw duplicate card-action tokens#104498
steipete merged 4 commits into
openclaw:mainfrom
VectorPeak:fix/feishu-redact-duplicate-card-token

Conversation

@VectorPeak

@VectorPeak VectorPeak commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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.

live event source: real Feishu card.action.trigger from interactive card button click
sent card message_id: om_x100b6a11b9...len=35
captured event file: .feishu-proof-104498/event-output-20260711-232118/1783783317756622300_20392_1.json
event type: card.action.trigger
event_id: 32ccfc0b...len=32
operator_id: ou_9ea19...len=35
chat_id: oc_5da7c...len=35
callback token: <redacted:c-d...len=42>
action_tag: button
action_value: {"nonce":"20260711-232118","proof":"openclaw-104498"}

OpenClaw replay using the captured real callback token:
first handleFeishuCardAction(...) call: dispatch count = 1
second handleFeishuCardAction(...) call with same account/token: duplicate skip count = 1
captured duplicate diagnostic: feishu[live-proof-account]: skipping duplicate card action token
raw callback token present in captured runtime logs: false

The replay command used the Feishu extension Vitest config so the event enters handleFeishuCardAction with 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 proof
  • node scripts/run-vitest.mjs run extensions/feishu/src/bot.card-action.test.ts - passed, 23 tests
  • node 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 regression
  • rg -n -F -- 'skipping duplicate card action token ${event.token}' extensions/feishu/src - no matches
  • rg -n -F -- 'card action token ${' extensions/feishu/src - no matches
  • git diff --check - passed

Remote CI note

Most PR checks passed on the current head. The remaining checks-node-compact-large-3 failure is in src/agents/session-write-lock.test.ts, outside the Feishu extension files changed by this PR. The Real behavior proof check is passing on the latest body update.

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>
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 11, 2026
@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. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 12:22 PM ET / 16:22 UTC.

Summary
The PR removes the raw Feishu callback token from duplicate-card-action diagnostics and adds regression coverage that preserves duplicate suppression.

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: 🦞 diamond lobster
Proof: 🦞 diamond lobster
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.

Next step before merge

  • No automated repair is needed because the existing PR already provides the narrow correct implementation, regression coverage, real behavior proof, and green exact-head validation.

Security
Cleared: The patch reduces sensitive provider-token exposure and introduces no authentication, permission, dependency, workflow, persistence, executable, or supply-chain changes.

Review details

Best 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 changes

Label justifications:

  • P2: The PR fixes a bounded sensitive callback-token exposure in Feishu diagnostics without changing authentication, delivery, configuration, or persisted state.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster 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): A redacted real Feishu card action was replayed twice through the handler, directly showing one dispatch, one duplicate skip, and no raw callback token in captured runtime logs after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. A redacted real Feishu card action was replayed twice through the handler, directly showing one dispatch, one duplicate skip, and no raw callback token in captured runtime logs after the fix.
Evidence reviewed

PR surface:

Source 0, Tests +17. Total +17 across 2 files.

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

What I checked:

Likely related people:

  • eleqtrizit: Authored the merged Feishu webhook replay-guard hardening that established the affected deduplication behavior. (role: introduced replay guard; confidence: high; commits: c8003f1b33ed; files: extensions/feishu/src/card-action.ts)
  • steipete: Recently maintained card-action token expiry and operator-log safety on the same Feishu handler and tests. (role: recent area contributor; confidence: high; commits: ac0fb976c8e2, ac24461252b0; files: extensions/feishu/src/card-action.ts, extensions/feishu/src/bot.card-action.test.ts)
  • Takhoffman: Authored the merged structured card-action and interactive approval foundation used by this callback path. (role: introduced structured card actions; confidence: medium; commits: fa62231afca3; files: extensions/feishu/src/card-action.ts, extensions/feishu/src/bot.card-action.test.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.
Review history (6 earlier review cycles)
  • reviewed 2026-07-11T13:55:31.518Z sha c712962 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T14:01:36.686Z sha c712962 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T14:51:06.825Z sha c712962 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T15:36:28.535Z sha c712962 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T15:43:36.824Z sha c712962 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T16:15:07.144Z sha 6351f18 :: needs maintainer review before merge. :: none

@VectorPeak

Copy link
Copy Markdown
Contributor Author

@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.

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 11, 2026
@VectorPeak

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with live Feishu runtime proof: a real card.action.trigger event captured via lark-cli event consume --output-dir, replayed through the current OpenClaw Feishu card-action handler twice with the same redacted provider callback token. The transcript shows one dispatch, one duplicate skip, and rawTokenPresentInLogs: false.

@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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 11, 2026
@steipete steipete self-assigned this Jul 11, 2026
@steipete
steipete merged commit d5569a9 into openclaw:main Jul 11, 2026
94 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…#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]>
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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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.

2 participants