Skip to content

fix(ui): keep chat at end after measured row growth - #166261

Merged
RomneyDa merged 1 commit into
mainfrom
openclaw/open-pr-to-fix-issue-166219
Oct 6, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
openclaw/open-pr-to-fix-issue-166219

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 6, 2026

Copy link
Copy Markdown
Member

Closes #166219

What Problem This Solves

Fixes: an unlocked chat follower can settle above the transcript end when a rendered row changes size during virtualizer correction.

User Impact

User impact: chats that are following the latest turn remain at the true end after late row measurement, while readers who scrolled away retain their position.

Why This Change Was Made

TanStack can correct the native offset after the host update that normally schedules end reconciliation has already completed. The correction updated the end anchor but did not schedule another reconciliation, leaving the exact post-measurement gap behind.

Route layout-correction receipts through the transcript host's existing end-reconciliation owner. That owner records the correction and schedules a fresh reconciliation with the existing connection, interaction, touch, restoration, and reader-lock guards intact. This complements #166258's release-branch content-change fix; it owns the later post-measurement correction on main.

Evidence

  • Original real-Gateway collaborator-scroll scenario: 20/20 standalone runs passed; every settled-history checkpoint ended at distance 0.
  • Exact original 14-file shard: 3/3 clean runs passed (14/14 files, 18/18 tests per run; final run 379.89 s).
  • Two intervening shard attempts exposed distinct unrelated sibling flakes: stale run state after a Vite proxy EPIPE, and lost widget draft persistence. The provider final/persistence evidence was healthy for the first; both sibling cases passed unchanged in subsequent clean runs. Neither was counted as clean proof.
  • Focused transcript owner tests: 102 passed in 19.11 s; prepend-anchor tests: 11 passed in 1.97 s.
  • Progress-card fixture consumers: 72 passed in 2.50 s.
  • node scripts/check-changed.mjs <four changed files>: passed, including format, lint, UI/core type graphs, ratchets, i18n, and dead-code scans.
  • AutoReview P0–P2: scoped-clean; no actionable findings.

No assertions, retries, or timeouts were weakened or increased. This is behavior-only; the existing real-Gateway boundary test is the regression proof.

@clawsweeper

clawsweeper Bot commented Oct 6, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 6, 2026 19:42
@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 Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 5:58 PM ET / 21:58 UTC (Revision 2).

ClawSweeper review

What this changes

The PR schedules chat-end reconciliation after late row measurements adjust the scroll position, preserving the existing reader-intent guards.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused repair for a gap still present on current main. No actionable introduced defect was found; the merged release-branch fix addresses a different scroll-follow transition.

Priority: P2
Reviewed head: ae433e2ac094890f988571d109e6b5384ed4fe1d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant reported boundary validation and no actionable correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its body reports real-Gateway browser runs exercising the changed transcript host through collaborator growth and persistence, with settled-history distance zero; those results were not independently replayed. 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: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its body reports real-Gateway browser runs exercising the changed transcript host through collaborator growth and persistence, with settled-history distance zero; those results were not independently replayed. No stored-data contract changes.
Evidence reviewed 10 items Pinned introduced change: The merge-base-to-head diff routes measurement corrections and layout clamps through the transcript host's existing reconciliation owner. The two test-support changes only supply the added callback.
Current main still has the gap: Fetched main directly records maintenance corrections in the end anchor without scheduling a new reconciliation. Its layout callback has the same limitation, so the central repair remains necessary.
Reader and lifecycle guards retained: The extracted reconciliation callback preserves connection and interaction checks, restoration and touch suspension, and current follow permission. The end-anchor owner still requires the viewport to match its retained anchor; disconnect cancels its scheduled frame.
Findings None None.
Security None None.

How this fits together

The Control UI virtualizes chat messages and measures rendered rows as their content changes. Its transcript host combines those measurements with reader intent to keep following viewers at the end while preserving scrollback.

flowchart TD
  A[Chat content grows] --> B[Virtualizer measures rows]
  B --> C[Scroll offset correction]
  C --> D[Transcript end reconciliation]
  E[Reader intent and active interaction] --> D
  D --> F[Follow latest messages]
  D --> G[Preserve reading position]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +12, Tests +2. Total +14 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 29 17 +12
Tests 2 2 0 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 31 17 +14

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #166219
Summary: This PR is the candidate main-branch repair for the linked collaborator-scroll validation failure; the release-branch content-growth repair is complementary.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep late measurement recovery in the existing transcript end-anchor owner, with current reader intent controlling every automatic follow.

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

Yes, the source establishes a concrete path: a maintenance correction after the queued reconciliation finishes updates the anchor without scheduling another pass on current main. Runtime reproduction was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Routing the correction through the existing host scheduler closes the missing lifecycle step without introducing a competing follow policy or weakening the regression assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded chat scroll-settlement defect observed during release validation without evidence of an urgent widespread regression.
  • 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. Its body reports real-Gateway browser runs exercising the changed transcript host through collaborator growth and persistence, with settled-history distance zero; those results were not independently replayed. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff routes measurement corrections and layout clamps through the transcript host's existing reconciliation owner. The two test-support changes only supply the added callback. (ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts:83, ae433e2ac094)
  • Current main still has the gap: Fetched main directly records maintenance corrections in the end anchor without scheduling a new reconciliation. Its layout callback has the same limitation, so the central repair remains necessary. (ui/src/pages/chat/components/chat-transcript-offset-observer.ts:169, f368d655393c)
  • Reader and lifecycle guards retained: The extracted reconciliation callback preserves connection and interaction checks, restoration and touch suspension, and current follow permission. The end-anchor owner still requires the viewport to match its retained anchor; disconnect cancels its scheduled frame. (ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts:90, ae433e2ac094)
  • Dependency contract signal: The production offset observer imports elementScroll and observeElementOffset from @tanstack/virtual-core, and ui/package.json pins version 3.17.11. This directly establishes the relevant virtualizer dependency boundary; no Codex contract is involved. (ui/src/pages/chat/components/chat-transcript-offset-observer.ts:1, ae433e2ac094)
  • Published virtualizer contract inspected: Read version 3.17.11 metadata and package/src/index.ts from the npm tarball in memory. The metadata identifies https://github.com/TanStack/virtual as its repository. resizeItem performs measurement compensation, and _scrollToOffset forwards behavior and adjustments to the consumer's scrollToFn, supporting the observer's maintenance-correction boundary. Package metadata supplies no source commit SHA. (packages/virtual-core/src/index.ts:2095)
  • Relevant boundary proof reported: The captured PR body reports 20/20 real-Gateway collaborator-scroll runs with settled-history distance zero, plus three clean original-shard runs. The inspected scenario uses two actual browser clients and real Gateway WebSockets, checks tail-following and scrollback through queue, streaming, and persistence, and uses a loopback inference fixture. These are author-reported results; this review executed no tests and inspected no runtime artifacts. (ui/src/e2e/chat-collaborator-scroll.real-gateway.e2e.test.ts:545, ae433e2ac094)

Likely related people:

  • Peter Steinberger: Raw commit cd060c5 adds ui/src/e2e/chat-collaborator-scroll.real-gateway.e2e.test.ts:545 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: cd060c5fde74; files: ui/src/e2e/chat-collaborator-scroll.real-gateway.e2e.test.ts)

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-10-06T19:47:27.928Z sha 9ba771b :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa force-pushed the openclaw/open-pr-to-fix-issue-166219 branch from 9ba771b to ae433e2 Compare October 6, 2026 21:52
@RomneyDa
RomneyDa merged commit 51f772a into main Oct 6, 2026
81 checks passed
@RomneyDa
RomneyDa deleted the openclaw/open-pr-to-fix-issue-166219 branch October 6, 2026 22:06
RomneyDa added a commit that referenced this pull request Oct 6, 2026
* ci(release): install Chromium for A-K live tests (#163178)

(cherry picked from commit 9ce1498)

* ci(release): pin reachable live provider models (#163177)

(cherry picked from commit 0fa2ddd)

* test(opencode): refresh free live tool model (#163470)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit cd7c2d2)

* test: synchronize Telegram recorder failure admission

Gate the synthetic control timeline on the recorder's durable failure receipt so slow filesystem publication cannot overtake the intended failure precondition. Preserve every assertion and align the touched fixture with the existing lint rules.

(cherry picked from commit 0dfb96f)

* fix(ui): reconcile end after layout correction (#166261)

(cherry picked from commit 51f772a)

* fix(ci): forward live video provider credentials (#164317)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d0ce76b)

* fix(security): backport MCP dependency advisory fix

(cherry picked from commit c39d9b0)

* fix(test): make live qualification waits event driven

* fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003)

gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
(cherry picked from commit 8095d77)

---------

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* ci(release): install Chromium for A-K live tests (#163178)

(cherry picked from commit 9ce1498)

* ci(release): pin reachable live provider models (#163177)

(cherry picked from commit 0fa2ddd)

* test(opencode): refresh free live tool model (#163470)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit cd7c2d2)

* test: synchronize Telegram recorder failure admission

Gate the synthetic control timeline on the recorder's durable failure receipt so slow filesystem publication cannot overtake the intended failure precondition. Preserve every assertion and align the touched fixture with the existing lint rules.

(cherry picked from commit 0dfb96f)

* fix(ui): reconcile end after layout correction (#166261)

(cherry picked from commit 51f772a)

* fix(ci): forward live video provider credentials (#164317)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d0ce76b)

* fix(security): backport MCP dependency advisory fix

(cherry picked from commit c39d9b0)

* fix(test): make live qualification waits event driven

* fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003)

gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
(cherry picked from commit 8095d77)

---------

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>

(cherry picked from commit 8aa6d7c)

Release adaptation: Select only live-shard evidence handling for disabled llama.cpp, Meta, and Mistral URL/key prerequisites. Re-home regression cases in the stable evidence helper; no workflow credentials, dependencies, or fixture ownership changes.

Companion audit: Historical release bundle is not on pinned main and #166341 has no pinned-main PR mentions. Recorded backports for Chromium, provider routes, workflow secrets, MCP versions, UI and Gateway fixtures are unrelated to the evidence slice; no additional commit.

Co-authored-by: RomneyDa <[email protected]>
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

CI flake: collaborator-scroll real-Gateway assertion drifts under full release validation

1 participant