Repository navigation
refactor: remove synthetic chat callback recovery - #134184
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:36 AM ET / 14:36 UTC. ClawSweeper reviewWhat this changesThe PR removes defensive coercion around typed internal chat-text callbacks, deletes tests for callbacks deliberately cast to violate that contract, and removes a duplicate iMessage envelope label. Merge readinessThe patch is correct: it keeps coercion at the untyped content boundary, while all in-repository callback producers satisfy the declared string contract. This member-authored, maintainer-labeled PR remains open for explicit maintainer handling and exact-head CI completion. Priority: P3 Review scores
Verification
How this fits togetherShared chat helpers convert raw or structured message content into normalized text for agent context, queue summaries, and chat handling. Envelope stripping removes recognized generated channel prefixes before display and reporting consumers use the text. flowchart LR
A[Raw chat content] --> B[Shared text coercion]
B --> C[Typed sanitizer]
C --> D[Typed normalizer]
D --> E[Agent and queue consumers]
F[Channel-prefixed text] --> G[Envelope recognition]
G --> H[Display and reporting consumers]
Decision needed
Why: The patch is behavior-neutral by the inspected in-tree contract, but member authorship and the maintainer label require explicit maintainer judgment rather than automated closure or merge advice. Before merge
Agent review detailsSecurityNone. PR surfaceSource -5, Tests -20. Total -25 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the canonical typed internal callback contract and duplicate-free envelope list, then land only after a maintainer confirms the scope and exact-head checks are green. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-neutral internal refactor, not a report of a user-facing defect. Is this the best way to solve the issue? Yes. The shared helper continues to coerce untyped message content at its boundary, and inspected in-tree callback producers already return strings; retaining recovery for deliberate type violations would preserve unsupported behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9323eae1deab. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The chat-content tests require recovery from internal string callbacks that deliberately violate their declared contract. That synthetic case keeps redundant coercion around values already produced by the internal normalizer and sanitizer. The envelope helper also lists iMessage twice.
Why This Change Was Made
Keep coercion at the raw message-content boundary and use the typed internal callback results directly. Remove the invalid-callback case, the unreachable duplicate label, and three generic header comments. All concrete callback producers return strings; the public extraction facade does not expose callback options.
User Impact
Valid message extraction and envelope stripping are unchanged. Raw unknown content still uses the identical coercion helper, including object serialization and cycle handling. Sanitizer receiver binding, normalizer invocation order, separators, empty-result behavior, and all unique envelope labels remain intact. Deliberately invalid internal callbacks no longer receive accidental recovery.
Production: +2/-7, net -5 lines. Tests: -20 lines, one case removed.
Evidence
Read the owners, internal callers and callback producers, public facade, sibling sanitizers and envelope consumers, and the raw-parent history introducing both the synthetic case and duplicate label. The same six focused suites pass before (103 cases) and after (102), with every surviving case name and per-file order preserved.
Nine temporary executable before/after vectors produce identical results and callback traces, covering malformed raw values, cyclic content, custom separators, default and supplied normalization, canonical sanitization, callback receiver/order, empty arrays, and unsupported top-level values. These probes are not added to the permanent suite.
All 29 required changed-file checks pass, including core and core-test typechecks, lint, formatting, dead exports, and repository guards. Scoped Codex review is clean. No external provider behavior, configuration, persistence, or public callback API changes.