Repository navigation
improve(chat): skip unused streaming reveal preparation - #158534
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 September 25, 2026, 10:03 PM ET / September 26, 2026, 02:03 UTC (Revision 2). ClawSweeper reviewWhat this changesThe shared Apple chat renderer now prepares word-reveal metadata only for the last prose block in each incomplete Markdown snapshot, with Swift tests for formatting and completed snapshots. Merge readiness✅ Ready for maintainer review Current main still prepares reveal metadata for every prose block. This focused PR remains useful, and review found no blocking patch defect. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's Apple chat view turns streaming assistant text into Markdown blocks and native views. The streaming view selects one prose location for its word-reveal animation. flowchart LR
A[Streaming assistant text] --> B[Text segments]
B --> C[Markdown blocks]
C --> D{Last prose block?}
D -->|Yes| E[Reveal metadata]
D -->|No| F[Attributed text]
E --> G[Native chat view]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +94. Total +94 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the existing Markdown segmentation and render path while building word-reveal pieces only for prose that the native streaming view can animate. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: current-main source establishes the extra preparation, but no end-to-end speed or memory effect has been measured. Is this the best way to solve the issue? Yes. Selecting the last prose block during snapshot construction matches the renderer's existing block boundary, and the tests check the rendering behavior that must remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a99102804eba. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
) * improve(chat): skip unused streaming reveal preparation * style(chat): use an if expression for reveal selection Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Streaming assistant Markdown prepares word-reveal metadata for earlier prose blocks even though only the last top-level prose block in an incomplete snapshot can use it.
User Impact
No visual or behavioral change is intended. Earlier prose retains its attributed text and formatting without preparing unused reveal text and tail pieces. End-to-end speed and memory effects have not been measured.
Why This Change Was Made
The snapshot now identifies the last prose block from the existing canonical segmentation and prepares reveal metadata only for that block while the snapshot is incomplete. A trailing heading or other structural block does not change which prose is selected.
Completed snapshots preserve the existing reveal flag and inline-math behavior. Markdown parsing, block order, images, disclosure recursion and reveal lifecycle are unchanged. This adds no cache and does not make parsing incremental.
Evidence
git diff --checkpassed. The change is limited to the snapshot constructor and its existing test file.86e82cf3d47dd3c87e079548a4bb4535d281876c, macOS package CI passed 1,799 shared-kit tests in 142 suites (35.118s), plus 16 native-state tests separately (0.245s). Both new snapshot cases passed (3.298s and 3.299s); their renderer suite reported 3.611s. The existing hosted append/replacement/reasoning case passed in 5.798s, with parser/segmenter/reveal/math siblings passing. These are parallel-CI durations, not isolated test cost or a speed comparison.9943be3f04f509237a600a53f9c625584171cb23; both changed file blobs exactly match the first PR head.conditionalAssignmentrule. Those failures are retained. The separate ChatView length warnings are not that error.f6c533aeea1120f6e6c270f6c80b4b2cea062e7bmakes only the required mechanicalif-expression correction (+3/-4); the predicate, branches and test bytes are unchanged.069637c71bd74f3b23a11e13175c73a267c83814; both changed file blobs exactly matchf6c533a. Run36209363646completed successfully: all 44 jobs completed, no failed jobs. macOS tests, iOS smoke, both screenshot lanes and their evidence job passed; Swift lint passed in the macOS-test and iOS-smoke lanes. Both requiredopenclaw/ci-gatecontexts are green. No named UIKit smoke pass is claimed.GatewayExternalAuthorizationError, its initializer anderrorDescription. That auth owner is untouched by this PR and byte-identical to its previously inspected source. This is a recorded unrelated failure, not a passing scanner result or a waived native gate.f6c533areports findings none, security none and before-merge items none.