Repository navigation
improve(ios): avoid reparsing unchanged chat messages - #198111
Conversation
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 31f2e24a-0df0-4786-a292-2c1fef57acec
|
🦞👀 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. What this changesThis PR retains one prepared Markdown document per mounted native renderer and rebuilds it when semantic input changes. Example: A mounted user message containing “Hello world” is refreshed without changing its text.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it addresses repeated preparation still present on main, and source review found no concrete introduced correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared Apple chat renderer converts raw Markdown or supplied snapshots into SwiftUI blocks for iOS and macOS chat surfaces. flowchart TD
A[Chat and reader surfaces] --> B[Raw Markdown input]
B --> C[Mounted renderer preparation]
C --> D[Markdown render snapshot]
E[Streaming snapshot owner] --> D
D --> F[SwiftUI blocks and images]
Technical reviewBest possible solution: Retain the single mounted preparation slot at the existing renderer boundary, preserving synchronous replacement and prepared streaming snapshots. Do we have a high-confidence way to reproduce the issue? Source establishes eager preparation whenever raw-text callers reconstruct the renderer, but the frequency and user-visible cost have not been demonstrated by execution. Is this the best way to solve the issue? The proposed lifetime and semantic key fit the existing renderer owner, preserve prior rendering contracts, and avoid a global cache or parallel parser. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 03c925b74467. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +78, Tests +71. Total +149 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 12:29 AM ET / 05:29 UTC. |
|
Merged via squash.
|
Reuse prepared Markdown for unchanged mounted messages while invalidating on content, completion, and localized-summary changes. Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: mikengyn <[email protected]>
What Problem This Solves
Chat refreshes can prepare Markdown again for unchanged visible messages, including user messages and assistant messages with media.
User Impact
Mounted messages can reuse their prepared Markdown without changing their layout, styling, selection, accessibility, or disclosure state.
Why This Change Was Made
The renderer now accepts raw text cheaply and retains one prepared result for its mounted lifetime. Source replacement, completion changes, and changes to the localized default disclosure summary rebuild the complete document synchronously. Already-prepared snapshots still pass through unchanged.
This also covers completed list items, expanded progress-card Markdown, the full-message reader, and sidebar notepad Markdown through the same renderer. It does not freeze streaming prefixes or claim to eliminate prior-block preparation on a new streaming delta. There is no global cache, new async rendering phase, or change to word-fade timing.
Evidence
Maintainer verification on
ff3fdd25559658ad0570c1f62247a17bfbe635dc, compared with0633f256350b5580a5bdbcd8a6a5782750de03d4:Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by