Skip to content

fix(ui): avoid extra chat rail work while replies stream - #146883

Merged
vincentkoc merged 2 commits into
mainfrom
perf/chat-rail-targets-20260913
Sep 13, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
perf/chat-rail-targets-20260913

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: the conversation position rail repeatedly rescans unchanged saved messages while an assistant reply streams.

User Impact

Streaming replies avoid redundant browser work while the rail continues tracking messages that enter or leave the mounted transcript. No configuration or migration is required.

Why This Change Was Made

The existing observer now distinguishes changes to observed message targets from edits inside those messages. Direct and nested message mounts, removals, and identity changes still reconcile the target set. The change adds no cache and preserves the existing observer lifecycle.

Production changes: +16/-5 (net +11), needed to express which mutations change target membership. Tests: +106/-1.

Related grouping work: #143296. This fix preserves the current grouping and message-selector contract.

Evidence

  • Independent owner/dependency review is clear.
  • The new regression uses the real transcript renderer and native MutationObserver. It checks zero full target scans across three streamed updates, then verifies direct/nested mounts, removals, and identity adoption/removal.
  • Required autoreview completed with no actionable P0–P2 findings. Remote baseline/candidate tests and existing browser navigation coverage are pending.
  • This is a reduction in redundant browser work; no end-to-end latency improvement has been measured.

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

clawsweeper Bot commented Sep 13, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 08:37
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:54 AM ET / 10:54 UTC (Revision 3).

ClawSweeper review

What this changes

The PR filters chat position rail notifications so streamed text edits avoid rescanning saved message bubbles, while message mounts, removals, and identity changes still update tracking.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused optimization absent from current main and the latest release. No blocking correctness findings were identified; the related grouping PR addresses different behavior.

Priority: P2
Reviewed head: ad0c95a7d51175e1b8fa04b80a6d8370c4faed66

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with meaningful regression coverage and no identified blocking defect; runtime performance gains remain unmeasured.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its renderer regression supports the observer logic; the related screenshots do not establish runtime scan reduction or latency improvement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its renderer regression supports the observer logic; the related screenshots do not establish runtime scan reduction or latency improvement.
Evidence reviewed 9 items Introduced filter and lifecycle: The complete production module retains observer cleanup, identity reconciliation, marker invalidation, and intersection-driven visibility. Its attribute observer watches only data-entry-id; child mutations trigger reconciliation when added or removed elements contain matching bubbles.
Current-main necessity: Comparing the inspected production module with fetched main shows main still uses the broad mutation filter; the difference matches the independently pinned introduced production hunks.
Latest-release comparison: The supplied latest release, v2026.9.4, also schedules a full target reconciliation for every child mutation outside the rail; this optimization is not present there.
Findings None None.
Security None None.

How this fits together

The Control UI’s conversation position rail turns saved messages into navigation markers. It observes mounted transcript bubbles to highlight the reader’s position as messages stream or virtualization replaces nodes.

flowchart TD
  A[Saved messages] --> B[Rail navigation markers]
  C[Transcript DOM changes] --> D{Message targets changed?}
  D -->|Yes| E[Reconcile observed bubbles]
  D -->|No| F[Keep existing targets]
  E --> G[Update visible message markers]
  B --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +11, Tests +105. Total +116 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 5 +11
Tests 1 106 1 +105
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 122 6 +116

Review metrics

None.

Technical review

Best possible solution:

Keep target-membership invalidation in the existing rail observer while leaving message geometry and reader position with their current owners.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: streamed descendant replacements reach main’s subtree observer and mark unchanged targets dirty, causing another full scan. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Filtering membership-changing mutations at the existing observer is a narrow repair that preserves identity updates, virtualization tracking, and lifecycle cleanup without another cache or owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c015302f7ff9.

Labels

Label justifications:

  • P2: This is a bounded browser-performance improvement during streamed replies, with no demonstrated urgent workflow failure.
  • 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: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its renderer regression supports the observer logic; the related screenshots do not establish runtime scan reduction or latency improvement.

Evidence

What I checked:

  • Introduced filter and lifecycle: The complete production module retains observer cleanup, identity reconciliation, marker invalidation, and intersection-driven visibility. Its attribute observer watches only data-entry-id; child mutations trigger reconciliation when added or removed elements contain matching bubbles. (ui/src/pages/chat/components/chat-position-rail.ts:130, ad0c95a7d511)
  • Current-main necessity: Comparing the inspected production module with fetched main shows main still uses the broad mutation filter; the difference matches the independently pinned introduced production hunks. (ui/src/pages/chat/components/chat-position-rail.ts:130, c015302f7ff9)
  • Latest-release comparison: The supplied latest release, v2026.9.4, also schedules a full target reconciliation for every child mutation outside the rail; this optimization is not present there. (ui/src/pages/chat/components/chat-position-rail.ts:129, 3a9d69db306c)
  • Regression coverage: The added test uses the real transcript renderer and jsdom MutationObserver, with a stubbed IntersectionObserver. It checks zero root target scans during three streamed Markdown updates and reconciliation for direct/nested mounts, removals, and identity adoption/removal. Tests were inspected, not executed in this read-only review. (ui/src/pages/chat/components/chat-position-rail.test.ts:33, ad0c95a7d511)
  • Renderer contract: The transcript supplies position messages to the rail, and rendered message bubbles always retain the chat-bubble class with identity supplied through data-entry-id. The change does not alter rendering, navigation, sanitization, or provider contracts. (ui/src/pages/chat/components/chat-message-bubble.ts:557, ad0c95a7d511)
  • Review continuity: Both touched files are identical to the earlier reviewed head. The supplied completed-review projection contains no findings or published rank-up moves; no historical blocker was inferred from the previous status. (ad0c95a7d511)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • brokemac79: 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 (2 earlier review cycles)
  • reviewed 2026-09-13T08:44:19.107Z sha 1eb94bb :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T10:39:22.962Z sha 1eb94bb :: needs maintainer review before merge. :: none

* refs/heads/temp/pr-146883: (159 commits)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  ...
@vincentkoc
vincentkoc merged commit b1ff5d0 into main Sep 13, 2026
226 of 228 checks passed
@vincentkoc
vincentkoc deleted the perf/chat-rail-targets-20260913 branch September 13, 2026 11:06
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-146802: (51 commits)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  fix(backup): preserve discovery under concurrent state writes (#146912)
  fix: keep queued deliveries in their original state directory (#146917)
  fix(discord): settle voice waveform work before releasing input (#146885)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'ccfd2377cd07d1ad3a583ba64d08e29a065f7061': (1587 commits)
  fix(ui): avoid recapturing chat drafts during UI updates (#146884)
  fix(ui): show system uptime in the debug overlay (#146960)
  fix(retry): honor waits beyond the native timer limit (#145718)
  fix(ui): keep chat history idle when run status changes (#146802)
  fix(ui): reuse persisted text during chat streaming (#146831)
  refactor(qa): share harness drift result construction (#146903)
  test(agents): coordinate settings lock contention (#146949)
  fix(worker): avoid repeatedly serializing screenshot history (#146907)
  fix(secrets): stop buffered upload writes after cancellation (#146840)
  perf(doctor): avoid unnecessary state runtime imports (#146926)
  improve: reduce compaction request estimation work (#146961)
  fix(ci): wait for forwarded avatar imports before assertions (#146729)
  perf(workers): skip configured Git author lookups (#146833)
  fix: admit borrowed memory writes through the agent database owner (#146760)
  fix(discord): prevent voice playback gaps and stale turn controls (#146798)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  ...

# Conflicts:
#	test/tsconfig/tsconfig.core.test.agents-other.json
#	test/tsconfig/tsconfig.core.test.agents-root.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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