Repository navigation
fix: land on the latest chat message when a conversation's rows arrive in two steps - #2319
Conversation
…ter landing The initial landing can be confirmed on an early projection of the transcript (for example two rows that fit without scrolling). When the full projection arrives, the follow path's staged bring can be cancelled by the reflow layout wait and the reflow offset correction can complete without moving, so the view stays at the top while still following. After a confirmed landing, InitialTailVerification watches the settled view for one bounded window (120 frames, two re-issues, never replenished). If the tail grew and the following view settles away from it with no owned work pending, it re-issues the existing staged tail bring. Arrival at the tail spends the growth and revokes queued work. Reader input, history navigation, loss of following, row clearing, a new request, scroll-view replacement, unload and dispose end the window. Exhaustion logs a warning and leaves Jump to latest visible. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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 adds bounded verification that retries initial chat positioning when a later row projection leaves the newest message offscreen. Example: A conversation first displays two rows that fit, then expands to four rows with a scrollable height of 816 pixels.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it addresses a source-supported chat landing failure still present on main, and review found no definite introduced code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Reactor timeline supplies keyed transcript rows to InitialTailPositioner, which coordinates native ItemsView scrolling and reports tail visibility to Jump to latest. flowchart LR
Rows[Keyed transcript rows] --> Positioner[InitialTailPositioner]
Input[Reader input and native geometry] --> Positioner
Positioner --> Policy[InitialTailVerification]
Policy --> Bring[Existing staged tail bring]
Bring --> View[Native ItemsView]
Positioner --> Jump[Jump to latest visibility]
Technical reviewBest possible solution: Keep recovery within InitialTailPositioner, reuse staged native navigation, and preserve bounded work and reader cancellation. Do we have a high-confidence way to reproduce the issue? Source supports the follow/reflow cancellation path, the linked tracker records the matching main failure, and the author reports repeated native reproduction; this review executed no target code. Is this the best way to solve the issue? The bounded verifier is a coherent scoped repair that reuses native realization and preserves existing admission rules; it does not resolve the broader scroll-owner work or projections arriving after its observation window. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a912363c971a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
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. Review metrics
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 Reviewed November 18, 2026, 4:12 PM ET / 21:12 UTC. |
…croll to the end After a session switch the chat has no extent-growth correction left for that transcript revision, and a viewport resize granted only one correction plus the two landing retries per revision. Virtualized rows realized by a resize and a UI Automation scroll to the end keep remeasuring while a correction is in flight, so the final message could stop short of the viewport with Jump to latest shown (CI flake GatewayFixtureUiTests.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidths). - TailReflowCorrection: bounded growth budget (MaxGrowthCorrections = 8) per content revision or viewport resize; a resize also refills the two landing retries. Native remeasurement never refills either; reader input still clears. - Growth seen while a correction waits for layout spends no credit. - UpdateTail clears a pending-correction flag whose dispatch was abandoned. - Docs and ledger state the bounded budgets and the existing UI Automation scroll-away limitation (openclaw#2126 is the structural fix). Ported from the held fix ae0867a onto current main, keeping openclaw#2319's landing retries and pinned correction anchor. Co-authored-by: Copilot App <[email protected]>
…croll to the end (#2417) * fix(chat): long chats reach the latest message after a resize and a scroll to the end After a session switch the chat has no extent-growth correction left for that transcript revision, and a viewport resize granted only one correction plus the two landing retries per revision. Virtualized rows realized by a resize and a UI Automation scroll to the end keep remeasuring while a correction is in flight, so the final message could stop short of the viewport with Jump to latest shown (CI flake GatewayFixtureUiTests.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidths). - TailReflowCorrection: bounded growth budget (MaxGrowthCorrections = 8) per content revision or viewport resize; a resize also refills the two landing retries. Native remeasurement never refills either; reader input still clears. - Growth seen while a correction waits for layout spends no credit. - UpdateTail clears a pending-correction flag whose dispatch was abandoned. - Docs and ledger state the bounded budgets and the existing UI Automation scroll-away limitation (#2126 is the structural fix). Ported from the held fix ae0867a onto current main, keeping #2319's landing retries and pinned correction anchor. Co-authored-by: Copilot App <[email protected]> * test(chat): consolidate tail reflow budget tests Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Copilot App <[email protected]>
Related: #2262
What Problem This Solves
When you open a chat or switch to a conversation, the transcript is supposed to land at the newest message. Sometimes it stays at the top instead, even though the chat still behaves as if it is following the newest message. This happens when the conversation first renders a short preview of its rows and then the full set arrives a moment later. The same bug makes
ConversationParity_ProgrammaticOrComposerFocusRetainsFollowingflaky on main ("Initial tail did not settle: offset=0").User Impact
User impact: opening or switching to a conversation now reaches the latest message even when its rows arrive in two steps. If the bounded recovery still cannot reach it, the view stays put with Jump to latest visible. It no longer sits at the top while claiming to follow.
Why This Change Was Made
The landing is confirmed on the first, short projection, where the top is also the bottom. When the full projection arrives:
This is a small targeted fix, not the staged scroll-owner rewrite. After a confirmed landing, a pure policy,
InitialTailVerification, watches the settled view for one bounded window: 120 frames, with a fixed budget of two re-issues that is never replenished.When it re-issues. All of these must hold:
ScrollCompleted).It then re-issues the existing staged tail bring. The dispatcher rechecks all of this before starting.
What stops it.
What it does not change. Follow and reflow admission are unchanged. Reader positions are never captured or restored. When the budget runs out, it logs a warning and leaves Jump to latest visible.
The new ledger row
chat-initial-tail-verificationindocs/ARCHITECTURE.mdrecords the owner and these invariants. The policy is shaped to move into the planned single scroll policy later; #2126 stays draft.Known limits (documented, not fixed here):
ViewChangedand following, the same signal main's follow and reflow already use. A no-op UIASetScrollPercent(0)at offset 0, or a UIA move that stays within 60 px while the grown tail has not been reached yet, cannot be told apart from layout drift without a ScrollPresenter automation-peer route. Main's follow path behaves the same in those cases.Evidence
cc46d14c):ConversationParity_ProgrammaticOrComposerFocusRetainsFollowingfailed in 9 of 12 cases over 6 runs. The signature matched CI:offset=0; maximum=816; count=4; expectedKey=…id:e2. Barbara's desktop session was Active, the native desktop lock was held, and the desktop-continuity monitor recorded no anomalies.ConversationFeedback_ThinkingToolReviewsAndHistoryRetainComposerWithoutSearch: 8/8.ReactorChatLayoutProofTestsclass: 215 passed, 1 failed, 3 skipped. The failure,ProductionRoot_AlignsColumnAndKeepsEveryComposerActionReachable(width: 1200), is a sub-pixel composer geometry assert. It fails the same way on clean main on this host, along with the intermittentReasoningPicker_MenuFocusAndDismissalDoNotCommit.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidthsfixture: 2/2 on this head (5/5 across revisions of the fix).MarkdownSelection_CopiesAcrossBlocksAndExcludesCollapsedAndNeighboringContentfixture (external UIASetScrollPercenton the timeline): 2/2.gpt-6-astra) design critique: 4 rounds. All findings closed, with the UIA exception above accepted. Final verdict GO.c769c679. Both GO, no blocking findings. Opus's non-blocking notes are listed under Known limits.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: chat transcript landing behavior in the isolated WinUI app. The native layout proofs and gateway-fixture UIA runs above were collected locally on Debug. Release native proof was not run.Validation
Everything required passed on patch-id
c769c679de001c215beefb24fab907db1a21fd4b(commit1691d247), basecc46d14c. Tests used isolatedOPENCLAW_TRAY_*profile roots, withOPENCLAW_STATE_DIRunset. The real profile showed no drift../build.ps1: passed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: passed (5910 passed, 29 skipped, 0 failed).dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: passed (6761 passed, 0 failed). This includes 6 newInitialTailVerification_*policy tests..\scripts\validate-test-timing-patterns.ps1: passed..\scripts\validate-docs.ps1: passed..\scripts\validate-proof-pools.ps1: passed.git diff --check: clean.dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64 --no-build --filter …):ConversationFeedback: 8/8;Real Behavior Proof
1691d247(patch-idc769c679).dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64 --no-build --filter FullyQualifiedName~ReactorChatLayoutProofTests.ConversationParity_ProgrammaticOrComposerFocusRetainsFollowing, 8 runs.System.TimeoutException : Initial tail did not settle: frames=170; settled=0; extent=1404.67; viewport=588.67; offset=0; maximum=816; state=Idle; count=4; expectedKey=…id:e2.Security Impact
Yes, explain the risk and mitigation: N/ACompatibility and Migration
Review Conversations