Repository navigation
fix(outbound): keep email addresses in plain-text replies - #124249
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 1:58 AM ET / 05:58 UTC. ClawSweeper reviewWhat this changesThe PR changes shared plain-text tag matching so RFC-style angle-bracket email addresses survive outbound formatting while valid markup continues to be removed. Regression provenancePossible regression — probable (reproduction; failure trace). No predecessor PR is attributed. Merge readinessKeep open: the focused shared-sanitizer repair is correct and addresses a current silent outbound-content loss; no blocking correctness or security finding was identified. Priority: P1 Review scores
Verification
How this fits togetherThe shared outbound sanitizer converts model-produced markup into text before channel delivery and is exported to plugin channels. iMessage applies an additional final safety projection before the shared sanitizer, while Telegram, Google Chat, IRC, WhatsApp, and direct channels consume the shared result through their adapters. flowchart LR
A[Assistant reply] --> B[iMessage safety projection]
A --> C[Shared plain-text sanitizer]
B --> C
C --> D[Channel-specific adapter]
D --> E[Telegram and other transports]
E --> F[Recipient-visible message]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +16. Total +26 across 4 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. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the shared owner-boundary grammar correction after exact merge-head verification, retaining the short invariant comment and focused regression coverage. Do we have a high-confidence way to reproduce the issue? Yes — current-main source and direct regex evaluation show that @ terminates the old word-boundary match and removes a normal angle-address; the PR adds the corresponding owner-boundary regression. The contributor’s packaged reproduction was not re-executed locally because this is untrusted PR code. Is this the best way to solve the issue? Yes — narrowing the shared tag grammar fixes the owner that every plain-text consumer uses, without an email parser or per-channel exception; the iMessage projection is kept grammar-aligned. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e49527031942. 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 (3 earlier review cycles)
|
The generic HTML tag matcher ended the tag name at a word boundary, so an RFC 5322 angle-addr such as `Support <[email protected]>` matched as a tag and was deleted before send, with no warning and no marker. A tag name ends at whitespace, `/`, or `>`. Requiring that boundary keeps real markup, Google Chat `<users/...>` aliases, and runtime scaffolding stripping, and leaves `<local@domain>` in prose alone. The sibling patterns in this module already gate on the same boundary. Closes #124217
|
Rebased onto "Confirm focused sanitizer validation on the exact merge or rebased head." — done. Head is now The regression test still fails on pre-fix source at this base (production change reverted, new tests kept): Focused and sibling outbound suites on the rebased head, all green: On |
…penclaw#124249) Preserve RFC 5322 angle-address emails without weakening namespaced tag stripping, and keep the iMessage security projection aligned. Co-authored-by: Aria Ghasedi <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #124217
What Problem This Solves
Plain-text outbound sanitization treated an RFC 5322 angle-address such as
Support <[email protected]>as HTML and silently deleted the address beforedelivery. This affects every caller of the shared sanitizer, including Telegram,
iMessage, WhatsApp, IRC, Google Chat, direct channel delivery, and the public
openclaw/plugin-sdk/channel-outboundexport.Root cause and repair
HTML_TAG_REended tag names at\b. Because@follows a word character,<[email protected]>matched as a tag and the fixpoint stripper removed it.The shared matcher now includes the shipped XML-style
.and:namecharacters, then accepts only real tag-name terminators: whitespace,
/, or>. This preserves angle-address prose without adding an email parser or achannel-specific exception. Existing HTML and namespaced-tag stripping, Google
Chat
<users/...>aliases, autolinks, and internal scaffolding remain unchanged.The iMessage final security projection explicitly mirrors this shared HTML
grammar. Its duplicate matcher is aligned in the same change so its inspection
model cannot drift from delivery sanitization.
Architectural owner:
src/infra/outbound/sanitize-text.ts.Scope
slash-terminated aliases, colon/dot-qualified tags, and the iMessage final
security path.
Evidence
Pushed head:
c5150a0f45418301a362b244a6ded4d98062591a.Regression proof with the new test retained and the shared matcher reverted:
Final focused test command covered the shared owner, adjacent outbound helpers,
Google Chat alias behavior, and the iMessage security projection:
The compatibility regressions also failed before the final grammar repair:
Static proof:
Distill: removed eight redundant test lines; no new abstraction or special
case. Greybeard: no attributable complexity or catastrophic-backtracking
regression; the fixed-width lookahead keeps the same asymptotic cost.
Redacted live Telegram proof
The dedicated QA user sent the changed-path prompt to a fresh exact-head Gateway
in a direct chat. The Gateway used the deterministic mock provider, then sent
the response through the real Telegram Bot API. Secrets, account ids, chat ids,
and usernames are omitted.
The Telegram client rendered away the angle brackets, but the reported failure
was deletion of the complete address. The recipient-visible address now remains.
Artifacts:
events.ndjson,summary.json,gateway.log, and one recorded mockprovider request.
Desktop GIF proof was unavailable because this exact PR head predates
scripts/e2e/telegram-desktop-recorder.ts; no unrelated recorder code was addedto the branch. The real-user TDLib event stream above is the final changed-path
proof.
ClawSweeper exact-head review
Local ClawSweeper passed on
c5150a0f45418301a362b244a6ded4d98062591a: