Skip to content

fix(whatsapp): preserve source direction for automatic reactions - #117697

Merged
steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-openclaw-117672
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-openclaw-117672

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #117672.

Automatic WhatsApp reactions now preserve the normalized inbound message direction when constructing the target key. This makes acknowledgement and status reactions address self-authored messages correctly when the bot is linked to the operator's own account.

Scope

  • Keep existing acknowledgement scope, reaction-level, and participant-resolution policy unchanged.
  • Cover acknowledgement send/removal and status set/clear with platform.fromMe: true.
  • Retain an explicit platform.fromMe: false control path.

Validation

  • Focused ack-reaction monitor test.
  • Focused status-reaction monitor test.
  • pnpm check:changed and git diff --check before handoff.

Credit

Thanks @lpulcheri for the report and root-cause analysis in #117672.

@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web size: S labels Aug 1, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: passed. Reviewed August 2, 2026, 12:53 AM ET / 04:53 UTC.

ClawSweeper review

What this changes

The PR makes WhatsApp automatic acknowledgement and status reactions address the source message with its normalized fromMe direction, adding regression coverage for self-authored messages.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for landing. Current main still hardcodes fromMe: false in the shared automatic-reaction eligibility path, while this focused patch carries the normalized inbound direction through both acknowledgement and status-reaction send/clear flows; no blocking patch defect was found.

Priority: P2
Reviewed head: 5060d03bc51f343abd808a29bb55ef0e1033c5a8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, owner-boundary repair with direct regression coverage and no blocking correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This bot-authored autofix PR is exempt from the external-contributor real-behavior-proof gate; the supplied context also reports successful proof checks, while the focused tests remain supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This bot-authored autofix PR is exempt from the external-contributor real-behavior-proof gate; the supplied context also reports successful proof checks, while the focused tests remain supplemental evidence.
Evidence reviewed 6 items Current-main defect remains: Current main prepares every automatic reaction with fromMe: false, although the shared helper receives the normalized inbound message and is used by both automatic reaction controllers.
Shared owner boundary: Acknowledgement send/removal and status set/clear both reuse the eligibility result's single reactionOptions object, so repairing that object covers all four operations without duplicate policy.
Reaction-key contract: The outbound wrapper forwards options.fromMe to the active listener, and the listener's transport-level test shows that value is written into react.key.fromMe; the direction is therefore address data, not merely logging metadata.
Findings None None.
Security None None.

How this fits together

The WhatsApp plugin normalizes each inbound message, then a shared eligibility step prepares the reaction target used by acknowledgement and status controllers. Those controllers send the target key through the active WhatsApp Web listener, which encodes the direction into the reaction key.

flowchart LR
  A[Inbound WhatsApp message] --> B[Message normalization]
  B --> C[Automatic reaction eligibility]
  C --> D[Acknowledgement controller]
  C --> E[Status reaction controller]
  D --> F[WhatsApp reaction sender]
  E --> F
  F --> G[WhatsApp Web reaction key]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; GitHub reports it mergeable, but required checks should validate the exact merge head before landing.
  • Complete next step (P2) - No repair dispatch is needed: the PR has no discrete actionable finding, and the remaining action is normal maintainer landing after exact-head validation.
Agent review details

Security

None.

PR surface

Source 0, Tests +103. Total +103 across 3 files.

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

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared eligibility repair so every automatic reaction uses the normalized inbound direction while preserving the existing false-direction behavior for ordinary inbound messages.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the shared eligibility repair so every automatic reaction uses the normalized inbound direction while preserving the existing false-direction behavior for ordinary inbound messages.

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

Yes, from source: an inbound message normalized with platform.fromMe: true reaches the shared automatic-reaction helper, which currently replaces that direction with false before the transport constructs the reaction key. This read-only review did not run a live WhatsApp device session.

Is this the best way to solve the issue?

Yes. Repairing the single shared eligibility result is the best fix because it serves acknowledgement send/removal and status set/clear together, instead of adding separate downstream exceptions.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded WhatsApp reaction-addressing regression with a focused repair and limited channel-specific blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This bot-authored autofix PR is exempt from the external-contributor real-behavior-proof gate; the supplied context also reports successful proof checks, while the focused tests remain supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Git blame identifies this commit as the origin of the shared reaction-options construction that now owns the incorrect constant. (role: introduced the current shared eligibility behavior; confidence: high; commits: 6a527b6e5531; files: extensions/whatsapp/src/auto-reply/monitor/reaction-eligibility.ts)
  • LiLan0125: Recent WhatsApp reaction-participant history includes a focused LID acknowledgement-reaction repair, making this a closely related owner path. (role: recent adjacent reaction-participant contributor; confidence: medium; commits: 86bd524a75d6; files: extensions/whatsapp/src/auto-reply/monitor/reaction-participant.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Validate required checks against the exact merge head before landing because the branch is behind main.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-01T23:50:28.300Z sha 5060d03 :: passed. :: none
  • reviewed 2026-08-02T01:05:02.881Z sha 5060d03 :: passed. :: none

@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🦞🧹
ClawSweeper autofix is enabled.

  • Head: 5060d03bc51f
  • Label: clawsweeper:autofix
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head until no actionable findings remain.

This is fix-only; I will not merge this PR.

Re-review progress:

@steipete
steipete merged commit 7492262 into main Aug 2, 2026
119 of 128 checks passed
@steipete
steipete deleted the clawsweeper/issue-openclaw-openclaw-117672 branch August 2, 2026 06:16
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
…nclaw#117697)

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: whatsapp-web Channel integration: whatsapp-web clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper Tracked by ClawSweeper automation P2 Normal backlog priority with limited blast radius. 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]: WhatsApp ack reaction silently never renders when the bot is a linked device of the operator's own account (hardcoded fromMe: false)

1 participant