Repository navigation
fix(whatsapp): avoid mentions inside unterminated inline code - #129281
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 10:11 AM ET / 14:11 UTC. ClawSweeper reviewWhat this changesThe PR makes WhatsApp outbound mention resolution ignore numeric mentions inside balanced or unterminated inline Markdown code, including multiline and multi-backtick spans. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding. The branch repairs the current resolver’s closed-single-line-only inline-code masking and covers both resolver output and the send payload boundary; it remains active and maintainer-labeled. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOutgoing WhatsApp text is formatted, resolved against group participants, and then sent with native mention metadata. The mention resolver decides which visible numeric tokens are rewritten and passed to the transport payload. flowchart LR
A[Outgoing Markdown message] --> B[WhatsApp formatter]
B --> C[Mention resolver]
C --> D[Code-span exclusion]
D --> E[Native mention payload]
E --> F[WhatsApp transport]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +68. Total +68 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the resolver-local delimiter-aware masking and its resolver-plus-payload regressions, then land only after exact-head validation is green. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s closed single-line matcher at extensions/whatsapp/src/inbound/outbound-mentions.ts:19 cannot protect the reported unterminated, multiline, or multi-backtick forms. Is this the best way to solve the issue? Yes. Updating the plugin-owned range decision before mention resolution is narrower and safer than compensating in the transport payload; the branch also tests that final boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47ba4ab30e8d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
6382d1a to
572bda9
Compare
|
Merged via squash.
|
…aw#129281) * fix(whatsapp): avoid mentions inside unterminated inline code * fix(whatsapp): protect mentions across soft code line breaks * fix(whatsapp): honor escaped multiline code delimiter runs
What Problem This Solves
WhatsApp turns phone numbers inside unfinished Markdown inline code into native participant mentions, including when the inline code crosses a soft line break or uses multi-backtick delimiters containing embedded shorter backticks. Escaped literal backticks can also incorrectly suppress legitimate intended mentions.
Why This Change Was Made
The canonical Markdown code-span parser matches equal-length delimiter runs, protects unmatched inline delimiters through the end of the input, permits soft line breaks, and distinguishes escaped literal delimiters. WhatsApp's separate outbound mention scanner originally recognized only closed spans; intermediate fixes missed soft newlines and multi-backtick delimiter runs. The scanner now follows the canonical rules without adding a new Plugin SDK surface.
User Impact
Phone numbers inside unfinished single-line, multiline, or multi-backtick inline code remain literal instead of sending native WhatsApp mentions. Escaped literal backticks do not suppress legitimate native mentions. Ordinary intended mentions, balanced inline code, fenced code, and other outbound behavior remain unchanged.
Evidence
node scripts/run-vitest.mjs extensions/whatsapp/src/inbound/outbound-mentions.test.ts extensions/whatsapp/src/inbound/send-api.test.tsnow passes all 73 tests.