refactor(whatsapp): centralize inbound turn admission and history finalization#107070
refactor(whatsapp): centralize inbound turn admission and history finalization#107070mcaxtr wants to merge 8 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 12:17 PM ET / 16:17 UTC. Summary PR surface: Source +49, Tests +108, Docs +2, Generated 0, Other +2. Total +161 across 22 files. Reproducibility: not applicable. This PR is a refactor and API-boundary proposal, not a report of a currently reproducible user failure. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Approve one documented Plugin SDK ownership boundary for decision-to-turn-admission mapping, then land this refactor only with the existing WhatsApp lifecycle invariants preserved by focused regression coverage. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a refactor and API-boundary proposal, not a report of a currently reproducible user failure. Is this the best way to solve the issue? Unclear: the lifecycle consolidation is a maintainable direction, but only a maintainer can decide whether the new public Plugin SDK mapper is the best permanent contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 359859d343bd. Label changesLabel justifications:
Evidence reviewedPR surface: Source +49, Tests +108, Docs +2, Generated 0, Other +2. Total +161 across 22 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 (11 earlier review cycles; latest 8 shown)
|
1a2527f to
b5252b7
Compare
8e09757 to
6510300
Compare
b49e5b2 to
8b8b58c
Compare
8b8b58c to
430f05e
Compare
0de0b73 to
cbca976
Compare
What Problem This Solves
WhatsApp duplicated two responsibilities already owned by the shared channel turn machinery: translating an SDK ingress decision into turn admission, and clearing pending group history after reply dispatch.
Keeping those decisions in the plugin made the WhatsApp receive path easier to drift from the core turn lifecycle.
What Changed
senderAccess,commandAccess, andactivationAccesscallback projections while addingturnAdmission. The complete resolved ingress object and its effective allowlists remain private.channel-ingress-runtime, the modern receive-path SDK owner.ChannelTurnPlanreturned throughrunChannelInboundEvent.Broadcast behavior is unchanged: each agent receives the same pending-history snapshot, per-agent core finalization is suppressed, and the existing broadcast barrier clears the shared history once after fan-out finishes.
Behavior and Compatibility
Reachable behavior remains unchanged:
Evidence