Repository navigation
fix(gmail): preserve wrapped header identifiers - #1191
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 October 7, 2026, 12:24 AM ET / 04:24 UTC. ClawSweeper reviewWhat this changesThe PR preserves standard Gmail header names in wrapped JSON output, wraps flattened sender and recipient text, and adds regression tests, documentation, and an Unreleased changelog entry. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main and v0.43.0 still wrap standard Gmail header names. No blocking correctness or security defect was found in the proposed patch. Priority: P2 Review scores
Verification
How this fits togetherGmail commands pass Google API responses through the shared JSON formatter. With untrusted wrapping enabled, the formatter marks external text before scripts or agents consume it. flowchart TD
A[Gmail API response] --> B[Message thread or draft command]
B --> C[JSON formatter]
C --> D{Untrusted wrapping enabled}
D -->|No| E[Ordinary JSON output]
D -->|Yes| F[Preserve fixed header identifiers]
F --> G[Wrap external text and header values]
G --> H[JSON for scripts and agents]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep standard Gmail header identifiers machine-readable while consistently marking sender-controlled text as untrusted. Do we have a high-confidence way to reproduce the issue? Yes: current-main source deterministically wraps From in payload header entries, matching the reporter's wrapped/unwrapped Gmail comparison; this review did not execute commands against Gmail. Is this the best way to solve the issue? Yes: the fixed ASCII allowlist follows the existing validated-metadata pattern and preserves value protection without exempting arbitrary header names. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6dcfcee20a82. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed in #1191. Standard ASCII header identifiers now remain usable for name-based selection at Gmail payload-header paths (including nested MIME parts). Custom/malformed names and all raw values remain wrapped; flattened sender and recipient display text is now wrapped too. The new synthetic regressions failed before the repair for message, thread, draft, and raw output. After the fix, focused formatter tests and the full Thanks @postoso for identifying both output inconsistencies. |
--wrap-untrustedwrapped Gmail header identifiers such asFrom, so JSON lookups by header name stopped matching. The shared formatter also left flattened From/To/Cc/Bcc display text unwrapped.Preserve a fixed allowlist of standard ASCII field names only at Gmail payload-header paths, including nested MIME parts. Custom names, malformed names, and all header values retain wrapping. Flattened sender and recipient display text now gets the same untrusted-content treatment as Subject and Reply-To. Documentation describes the boundary.
Regression coverage exercises message, thread, draft, raw, and nested-part output; custom and malformed names; unrelated name paths; flattened address headers; and Unicode case-folding aliases. The new tests failed against unchanged production code before the repair.
Fixes #1183. Thanks @postoso for the report.
Validation: failing-before/passing-after synthetic formatter regressions, full
make cion AWS Crabbox, and final independent Codex review through P2. The initial review caught Unicode case-folding of malformed header names; the final patch rejects those before matching.