Repository navigation
improve(ios): avoid reformatting unchanged parts of streaming replies - #198122
roboclaw-bot wants to merge 19 commits into
Conversation
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: eeb3fb41-afc6-4ff3-8230-37d6b03269a2
|
🦞👀 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 streaming Markdown preparation in the mounted view and reuses unchanged semantic blocks between updates. Example: An iOS reply contains 32 stable sections followed by a paragraph receiving 128 updates.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is a useful, maintainer-directed optimization with no introduced correctness or security finding. The earlier fence-rendering blocker is resolved outside the current diff; exact-head CI remains in progress. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared Apple chat UI receives assistant text segments, parses Markdown, prepares display blocks and reveal metadata, and renders them through SwiftUI on iOS and macOS. flowchart TD
A[Assistant text updates] --> B[Assistant segment parser]
B --> C[Mounted streaming preparation]
C --> D[Full Markdown segmentation]
D --> E[Semantic block reuse]
E --> F[SwiftUI renderer and word reveal]
Technical reviewBest possible solution: Retain one preparation per mounted streaming view and reuse semantically unchanged blocks while preserving complete parsing and existing reveal behavior. Do we have a high-confidence way to reproduce the issue? Current-main source reconstructs every rendered block for each changed streaming snapshot, and the supplied compiler-coverage measurements quantify that repeated work; this review ran no target code. Is this the best way to solve the issue? The change uses the existing mounted streaming owner, replaces eager initialization, retains only the current preparation, and preserves parser-owned structural changes; no unnecessary production layer was identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f52f728d3415. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +67, Tests +158. Total +225 across 4 files. Added test files: 1. 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:
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 HistoryReview history (1 earlier review cycle)
Reviewed November 16, 2026, 10:44 PM ET / November 17, 2026, 03:44 UTC (Revision 2). |
Worked on by: - @mikengyn - @vyctorbrzezowski Co-authored-by: mikengyn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 7ec31cd2-b5c4-43ce-8ed5-a3dab676e043
Stage the reviewed streaming preparation and current reader owners for native baseline integration. Qualification follows only after refreshing the remaining main context.
Baseline-Refresh: 95464db1329f38e111d8780cf3419c6d9678ad68 Co-authored-by: mikengyn <[email protected]> Co-authored-by: Vyctor H. Brzezowski <[email protected]>
|
Maintainer verification: rebased the preparation-only change onto current main and kept the already-landed reader/list/fence behavior. The final four-file tree passed 129 focused tests, independent review, actual preparation-count measurements, and a fresh native iOS visual pass. For the long reply, repeated block preparation falls from 66 to 1 per update; full parsing remains. Final content and settled reading position match the baseline. Before/after screenshots, videos, exact revisions, and simulated-Gateway limits are in the body. The old review targeted the inherited list implementation, which is no longer in this diff. Current main owns incomplete-fence handling. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What problem this solves
While a native iOS reply streams, unchanged Markdown sections are repeatedly prepared for display. A long answer with 32 stable sections and a growing final paragraph performed 66 block preparations per processed update.
What changed
Keep preparation in the mounted streaming view and reuse prepared blocks only when their semantic input, completion state, reveal role, and localized disclosure summary still match. Changed segments still use the complete Markdown parser, so later references and structural changes remain parser-owned.
The current-main integration narrows this PR to two renderer files, their focused preparation tests, and one generated translation-source entry for the existing “Details” key. The former parent, #192232, has landed. Its old reader, list, and fence changes are no longer part of this PR's delta; current main's scrolling and incomplete-fence behavior are preserved.
There is no global cache or new throttle. The retained data is the current streaming snapshot, not a history of updates. A single growing paragraph still requires its normal parsing and preparation.
Current verification
Candidate:
a1606c583ec86db498114f565476cec3c4fd2a23, integrated with main4cbd215af463775faa6807aea90621292b28af15. Its full tree matches the independently reviewed and tested four-file port.Actual compiler-coverage counts, with separate cold and warm processes:
This proves less repeated preparation, not faster full parsing. No first-content latency, frame-rate, CPU, or memory improvement is claimed.
Before/After
The images below show the same streaming checkpoint and completed tail. They are cropped native-app captures with synthetic content. The matching checkpoint images are byte-identical.
Videos show streaming and manual navigation. The baseline video joins its first eight and last ten seconds to remove an idle inspection interval; these clips are not a timing comparison.
base-public.mp4
candidate-public.mp4
CI qualification
The iOS screenshot job built the app successfully and passed three of four screenshot cases. The static chat case failed at
OpenClawSnapshotUITests.swift:269because the “Mermaid diagram” button did not appear.The renderer trace shows the WebKit document remained in its loading phase, with
documentReady=false, until its watchdog expired after 27,048 ms. The HTML resource had been delivered, but the document never reported ready.This screenshot uses completed fixture history, not a streaming reply. The new streaming preparation is not instantiated; the shared snapshot receives
preparesReveal=falseand no previous snapshot, so the new reuse branch does not execute. The screenshot, fixture, Mermaid loader/resources, and build inputs are byte-identical between the actual CI baselinef52f728d34158e66c0d11ce48cc7fb1c7a0cd6a7and tested merge6543bb204ee8d18a8093f3c032f20db408e1785b. That merge contains the exact published head and only this PR's four-file change relative to its baseline.Independent source review agrees this failure is outside the optimization's changed behavior. The underlying WebKit loading cause has not been isolated, and no baseline rerun is claimed. This failure is retained explicitly for the native unrelated-CI qualification; it is not reported as a passing screenshot test.
Current landing hold: Android Play tests also ended cancelled, after GitHub's 20-minute job deadline. The step reached
:app:testPlayDebugUnitTest; cancellation is not a passing test result. The completeapps/androidtree is identical between the tested baseline and merge (5ef9c3f110fd6a64af44b50993323a5c8b0ad622). The Apple transport and Periphery workflows subsequently passed. The native landing verifier refused admission because this Android deadline cancellation is not covered by its supported cancellation-provenance cases. No merge was performed, and auto-merge was retired. The prepared head and evidence are retained; no timeout or CI limit was changed.Work sessions
Linked for team reference; these sessions are not public.
Worked on by