Repository navigation
refactor(googlechat): share approval card text escaping - #134643
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 10:19 PM ET / September 1, 2026, 02:19 UTC. ClawSweeper reviewWhat this changesThis PR replaces two identical Google Chat approval-card escaping functions with one private extension helper and asserts the rendered pending and resolved-card text. Merge readinessThis behavior-preserving refactor remains useful: current main and the latest release still duplicate the same escaping rule. No actionable patch defect was found; this member-authored PR with a protected maintainer label should proceed through ordinary review after exact-head CI finishes. Priority: P3 Review scores
Verification
How this fits togetherGoogle Chat turns pending approvals and final decisions into card payloads. Command and metadata text are escaped before the plugin sends or updates those cards through the Google Chat API. flowchart LR
A[Approval command text] --> B[Pending card builder]
A --> C[Resolved card builder]
B --> D[Card text escaping]
C --> D
D --> E[Google Chat card payload]
E --> F[Send or update message]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +6. Total +3 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one private Google Chat card-text helper and land it once exact-head checks are green and ordinary maintainer review is complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior rather than reporting a runtime defect; source inspection confirms the duplicate functions and their card-delivery paths. Is this the best way to solve the issue? Yes: a private extension-local helper is the narrowest maintainable way to prevent the two equivalent card builders from drifting while preserving their separate truncation boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7779a09c23c4. LabelsLabel 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 (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Google Chat pending and terminal approval cards independently implemented the same HTML text escaping rule. The duplicate policy could drift on replacement order, entity handling, quote handling, or truncation order and produce inconsistent approval-card text.
Why This Change Was Made
This consolidates the exact three-character Google Chat approval-card escaping contract in one private plugin helper. Both callers retain their existing local name and truncation boundary. Ordinary message Markdown formatting, shared HTML helpers, card composition, IDs, SDK surfaces, config, packages, and protocol behavior are unchanged.
User Impact
No intended visible behavior change. Pending and terminal approval cards continue escaping
&,<, and>in that order, double-escaping existing entities, and leaving quotes and apostrophes unchanged.Evidence
+5/-6(net-1).+8/-2.<tag> & & "double" 'single'<tag> & &amp; "double" 'single'pnpm check:changedpassed conflict, max-lines, assertion-safety, changelog, doctor, extension boundary, duplicate coverage, dependency, formatting, doctor-contract, plugin-boundary, patch, and test-temp gates. It then stopped in the shared extension typecheck on eight unrelated existing Telegram dependency/type errors, including missingRichMessageButtonfromgrammy/types; this PR changes onlyextensions/googlechat/**.355/355) and completepnpm check:changed: Blacksmith leasetbx_01m1dbd7g91mc1j65dh1hp0r34, workflow run33461210429.0.99.../codex/codex-rs/cli/src/main.rs:220-245and../codex/codex-rs/cli/src/main.rs:2840-2870; unrelated to this plugin-local text contract.8f8d9ae57d1f11fc785d38341a4b20762d9cf733in workflow run33461699520; failed-job rerun recovered a transientECONNRESETwhile downloading@matrix-org/[email protected], and aggregateopenclaw/ci-gatejob99714357026succeeded.