Repository navigation
feat(whatsapp): add poll_vote_received hook - #119256
pscoutosoares wants to merge 60 commits into
Conversation
|
Codex review: needs real behavior proof before merge. What this changesAdds an opt-in WhatsApp plugin event for decoded poll votes and retractions, with account-monitor lifetime checks, documentation, and a live-proof harness. Review scores
Merge readiness⛔ Blocked before merge - 5 items remain Keep open: current main lacks this capability, and the branch contains useful, distinct work. Contract sponsorship and proof of the repaired disclosure boundary remain unresolved. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe WhatsApp plugin receives encrypted votes from its existing connection and decodes them using cached Gateway-sent polls. It checks ownership and current opt-in before delivering vote data to registered plugins without starting an agent turn. flowchart TD
A[Accepted Gateway poll] --> B[Account-bound ownership cache]
C[Incoming WhatsApp vote] --> D[Ownership and opt-in checks]
B --> D
D --> E[Decode cached poll vote]
E --> F[Bounded callback queue]
F --> G[Recheck account lifetime and opt-in]
G --> H[Plugin observation event]
Technical reviewBest possible solution: Adopt one sponsored, default-off observation contract with explicit lifetime limits and verified authorization at the final plugin disclosure boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this proposes a new observation capability, rather than repairing an established poll-result API. Is this the best way to solve the issue? Unclear pending owner acceptance; extending the existing WhatsApp connection and shared hook runner is coherent, but the payload and bounded lifetime need sponsorship. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b76ca2c669d3. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1190, Tests +2244, Docs +71, Generated 0, Other +30. Total +3535 across 61 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (67 earlier review cycles; latest 8 shown)
Reviewed October 2, 2026, 3:47 PM ET / 19:47 UTC (Revision 68). |
|
Pushed a follow-up commit addressing the review findings:
Local verification: "Real behavior proof" (live poll + live vote + observed hook firing against an actual WhatsApp connection) is still open — I don't have a live test setup for this locally. Happy to add it if that's a hard blocker, or if a maintainer can run it against a test instance. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Dependency graph guard clearedThis PR no longer has dependency changes awaiting review. A future dependency graph change from an external contributor requires a maintainer's
|
2826cd3 to
dbf26cc
Compare
|
Pushed 3 more commits addressing this review:
Not yet addressed, flagging explicitly rather than silently skipping:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up on Result: TruffleHog now runs clean against the full branch diff. In the process of tracking down why the tool refused to review (it flagged a file as binary), I found and fixed a real latent bug: With that fixed, Net: this is no longer a local-environment problem — the tooling runs correctly end to end — it's a genuine size/pass-cap limit on this branch's cumulative diff. Leaving the |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…-vote-fix # Conflicts: # docs/.generated/config-baseline.sha256 # extensions/whatsapp/src/send.test.ts # scripts/plugin-sdk-surface-report.mts
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for the PR. We're closing older pull requests that have gone stale against current This is a large (about 4,200 lines) new public hook whose sponsoring issue (#119254) was closed as not planned, and it still lacks the required proof with failing CI. Please start with a small design proposal for the hook contract if you want to pursue this. If this change is still needed, please open a fresh PR against current |
Related: #119254 (closed as not planned; it did not establish sponsorship for this public contract).
What Problem This Solves
WhatsApp plugins can passively observe decoded votes and retractions on polls accepted through the OpenClaw Gateway. The opt-in
poll_vote_receivedevent avoids separate WhatsApp polling or another agent turn.Behavior and lifecycle
The hook is limited to polls recorded from an accepted Gateway send. A
fromMeecho alone does not establish ownership. Ownership is bound to the exact WhatsApp account monitor lifetime; queuedpoll_vote_receivedand siblingmessage_receivedcallbacks revalidate that scope immediately before plugin dispatch. The scope is disposed when the monitor exits, before socket shutdown, so callbacks queued by a retired monitor cannot disclose data after an account slot is reused.The observation cache remains process-local, bounded to 500 entries, and expires after ten minutes. A restart or eviction ends observation of older polls; no persistent vote data or SQLite schema is added.
Contract and compatibility
channels.whatsapp.pluginHooks.pollVoteReceivedand the account-level override are optional booleans. Omitted means disabled; the account value overrides the channel value. Existing configs remain valid, the schema tests cover both levels and omission, and the generated bundled channel metadata includes the field. No migration is needed because the new value is optional.This is a public plugin contract that exposes voter, conversation, poll, and selected-option data. A listed WhatsApp/plugin maintainer still needs to sponsor that disclosure scope and explicitly accept the ten-minute process-local lifetime, including expiry, eviction, and restart.
Evidence and validation
mainthroughfecba819ef2e67952e52896501278dc9bee72d4bare resolved. The integrated SDK budget preserves upstream's retired exports and the PR's poll-event allowance; bothpnpm plugin-sdk:surface:checkandpnpm check:assertion-safetypass. Current PR head:cb00a538bebf117576e244d0f7ec36fb45a59d74.message_receivedpath asserts both plugin and internal callbacks remain at zero after its monitor closes.autoreviewon the source repair reported no accepted actionable P0/P1 findings; the finalmainmerge changes no runtime behavior.3136032aca05908ff5a3b9e0579f50abc9f16f00showed an isolated Gateway poll, a real WhatsApp vote, one matchingpoll_vote_receivedfixture event, hashed identifiers, candidate cleanup, and a healthy production Gateway. That run predates the monitor-lifetime repair, so it is not exact-head live proof for the new lifecycle binding.upstream/main: +725 production lines, +2,729 test/support lines, and +81 documentation/generated/tooling lines. The production growth is the new hook/config capability and shared hook contract; the lifecycle repair adds 92 net production lines to bind both queued callbacks to one monitor owner boundary, with 189 net test/support lines.Remaining before merge
ClawSweeper's final-effect rank-up move is covered by the tests above. Its separate maintainer-decision move remains open: a listed plugin/channel maintainer must sponsor the contract and observation lifetime.
.github/CODEOWNERShas no matching WhatsApp path, so the repository's CODEOWNERS rule does not identify that sponsor. Exact-head GitHub CI and the fresh ClawSweeper review are pending. Do not merge until CI is green and the sponsor decision is recorded.