Repository navigation
refactor(text): reuse quote state for XML tag scanning - #149105
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 6:48 PM ET / 22:48 UTC (Revision 2). ClawSweeper reviewWhat this changesReuses the existing quote scanner when locating XML tag boundaries in assistant text and adds coverage for quoted attributes and malformed markup. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, behavior-preserving cleanup absent from current main. No actionable defects were found, consistent with the previous review of the same head. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s shared text sanitizer removes tool-call scaffolding from model output before chat delivery and history display. XML boundary detection helps distinguish hidden payloads from ordinary prose and code examples. flowchart LR
A[Model output] --> B[Shared text sanitizer]
B --> C[Protect code examples]
C --> D[Scan XML boundaries]
E[Quote and escape state] --> D
D --> F[Remove payloads or preserve prose]
F --> G[Chat delivery and history]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -25, Tests +48. Total +23 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one private quote-state implementation for payload and tag scanning while preserving existing sanitizer output. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor claims no existing user-facing defect; source comparison supports equivalent scanner behavior. Is this the best way to solve the issue? Yes: reusing the existing private scanner removes duplicate logic without expanding APIs, changing parser policy, or introducing another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 14b8ad1d1871. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
XML tag-close handling now reuses the existing private quote-state scanner, removing a second quote/backslash state machine. Escaped quotes, unquoted
<rejection, tag boundaries, malformed markup, code-region protection, and UTF-16 offsets retain their existing behavior.Production: −25 lines (3 added / 28 removed). Tests: +48 lines, adding 13 XML quote-boundary cases. No public API, parser-policy, or dependency change.
Validation for
37a7779851597b585bf84180eadc367bff04171f:16a36abadf775ec4689f6b31e98676b629090677binds the tested source postimages to this head.Fixed-scope sloppiness score: 35.172430150309815 → 35.91470735595805. The score rises because high-complexity mass stays fixed while total mass falls; raw cyclomatic complexity drops 281 → 277. This is a structural measurement, with no runtime-speed or performance claim.