Repository navigation
refactor(apple): share native chat payload normalization - #129113
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 5:27 AM ET / 09:27 UTC. ClawSweeper reviewWhat this changesThe PR moves four equivalent native-chat string normalizers into Merge readinessKeep open for maintainer review: the refactor creates one private payload-normalization owner without changing the four callers’ semantics, and current main still has the duplicate local helpers. No actionable patch defect was found; exact-head native CI is still pending. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherIncoming native-chat events and task/Swarm snapshots are decoded into Apple chat state. This normalization feeds assistant-text extraction and the activity projections rendered by native clients. flowchart LR
A[Gateway chat and task payloads] --> B[Native chat payload decoding]
B --> C[Trim empty values]
C --> D[Assistant text extraction]
C --> E[Subagent activity state]
C --> F[Swarm activity state]
D --> G[Native chat display]
E --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceOther -9. Total -9 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the normalization private to payload decoding and merge once the exact-head Apple native checks confirm compilation and linting. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, and source comparison establishes the relevant normalization equivalence. Is this the best way to solve the issue? Yes: a private helper on the existing payload-decoding owner removes duplication without expanding a generic String API or crossing a product boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6fb330349200. 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
History |
|
Independent landing verification is clean at exact head
No proof gaps remain for this behavior-neutral internal refactor; proceeding through the repository-native prepare/merge gates. |
|
Merged via squash.
|
What Problem This Solves
Native chat event processing independently owned four equivalent string-normalization helpers. Each trimmed
whitespacesAndNewlinesand converted nil or empty results to nil, leaving identical behavior duplicated across event text, subagent activity, and two Swarm paths.Why This Change Was Made
This moves the shared internal contract to
ChatPayloadDecoding.trimmedNonEmptyStringand removes the four private implementations. It deliberately excludes outbound request normalization and session/sidebar normalization because those ownership paths are under active PRs #112004, #112227, and #128286.Rejected alternatives: a new utility file would add a source path and project-metadata burden; a module-wide generic
Stringextension would broaden the API surface beyond this payload boundary.Production LOC: +30/-39 (net -9) | Tests: +0/-0
User Impact
No user-visible behavior or compatibility change. Native chat payload normalization now has one owner instead of four, reducing future drift risk.
Evidence
Exact head:
9bac5c66ec55e80cd7efb329e325244728b5b6d0node scripts/check-changed.mjs -- apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatPayloadDecoding.swift apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSubagentActivity.swift apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatEventText.swift apps/shared/OpenClawKit/Sources/OpenClawChatUI/Swarm.swift— passed all guards and 7 routed Vitest shards (357 passed, 131 skipped).git diff --check origin/main...HEAD— passed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main) — clean, no accepted/actionable findings.macos-swift(Swift compilation/format/lint),ios-build, both iOS screenshot jobs, andopenclaw/ci-gate.