Skip to content

improve(chat): skip unused streaming reveal preparation - #158534

Merged
vincentkoc merged 2 commits into
mainfrom
improve-chat-last-prose-reveal-20260926
Sep 26, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
improve-chat-last-prose-reveal-20260926

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

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 --check passed. The change is limited to the snapshot constructor and its existing test file.
  • On first head 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.
  • That job tested merge 9943be3f04f509237a600a53f9c625584171cb23; both changed file blobs exactly match the first PR head.
  • Fresh independent autoreview completed with no P0-P2 findings; its report-file export failed because the destination directory was missing. Source and evidence verification completed before that export failure.
  • The first overall workflow failed: iOS smoke and both screenshot lanes rejected the renderer's assignment form under SwiftFormat's conditionalAssignment rule. Those failures are retained. The separate ChatView length warnings are not that error.
  • Current head f6c533aeea1120f6e6c270f6c80b4b2cea062e7b makes only the required mechanical if-expression correction (+3/-4); the predicate, branches and test bytes are unchanged.
  • Corrected-head macOS package CI passed 1,799 shared-kit tests in 142 suites (33.925s), plus 16 native-state tests separately (0.048s). Both new cases and the existing disclosure case passed (3.082s each); the renderer suite passed in 3.243s, and hosted replay passed in 5.445s. Parser, segmenter, reveal and math siblings passed. These remain parallel-CI timings, not a performance comparison.
  • Corrected CI tested merge 069637c71bd74f3b23a11e13175c73a267c83814; both changed file blobs exactly match f6c533a. Run 36209363646 completed 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 required openclaw/ci-gate contexts are green. No named UIKit smoke pass is claimed.
  • The separate shared Periphery intersection failed on GatewayExternalAuthorizationError, its initializer and errorDescription. 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.
  • Completed ClawSweeper review at f6c533a reports findings none, security none and before-merge items none.
  • Baseline-red execution is unrun. The original constructor's preparation of reveal metadata for every prose block is established by source inspection, not a claimed failing runtime result.

@vincentkoc vincentkoc self-assigned this Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 26, 2026 01:26
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 10:03 PM ET / September 26, 2026, 02:03 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: f6c533aeea1120f6e6c270f6c80b4b2cea062e7b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch with useful regression coverage and passing exact-head macOS package validation; no blocking defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: Contributor after-fix proof is not required for this MEMBER-authored PR. The changed native snapshot path has focused Swift test and exact-head macOS package CI evidence, but no app-level performance result is claimed; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Contributor after-fix proof is not required for this MEMBER-authored PR. The changed native snapshot path has focused Swift test and exact-head macOS package CI evidence, but no app-level performance result is claimed; no stored-data contract changes.
Evidence reviewed 9 items Introduced change: The pinned merge-base-to-head diff selects the last prose block and limits reveal preparation for incomplete snapshots.
Current-main necessity: Fetched main still passes the reveal flag to every rendered block, so the proposed optimization is absent.
Latest release check: The latest named release also uses the older constructor that passes reveal preparation to every block.
Findings None None.
Security None None.

How this fits together

OpenClaw'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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other +94. Total +94 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 97 3 +94
Total 2 97 3 +94

Review metrics

Metric Value Why it matters
Production versus test lines production +14 net; tests +80 The source growth has a narrow work-avoidance purpose, and the tests cover the changed selection and preserved rendering.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a narrow internal rendering-efficiency improvement with no intended visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Contributor after-fix proof is not required for this MEMBER-authored PR. The changed native snapshot path has focused Swift test and exact-head macOS package CI evidence, but no app-level performance result is claimed; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-26T01:33:51.423Z sha 86e82cf :: blocked before merge. :: none

@vincentkoc
vincentkoc merged commit a410b4d into main Sep 26, 2026
91 of 92 checks passed
@vincentkoc
vincentkoc deleted the improve-chat-last-prose-reveal-20260926 branch September 26, 2026 02:17
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
)

* improve(chat): skip unused streaming reveal preparation

* style(chat): use an if expression for reveal selection

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant