fix(chat): restore the tail when switching conversations - #1438
shanselman wants to merge 2 commits into
Conversation
Scope the native ItemsView and scroll-controller decorator to session and timeline generation. Keep same-session scrolling, virtualization, and row-targeted navigation unchanged. Add mounted native regression and lifecycle proof with isolated XAML resource setup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8346e696-3092-49d5-98be-80b5cae59048
Use the ScrollView operation correlation for manual reader scrolling after all natural-tail assertions. Keep token/revision checks strictly about reconciled native identity and supersede their pending navigation before checking a new session. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8346e696-3092-49d5-98be-80b5cae59048
|
🦞👀 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: blocked before merge. Reviewed September 17, 2026, 4:27 PM ET / 20:27 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch recreates the native chat list when the conversation or timeline generation changes and adds mounted Windows UI tests and testing guidance. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 5 items remain Keep open and blocked: the prior finding remains unresolved, and the author’s controlled real-app comparison rejects this candidate. Current main does not establish a replacement fix; collaborator-authored work also requires explicit maintainer disposition. Priority: P2 Review scores
Verification
How this fits togetherThe Windows chat timeline receives the selected conversation’s cached or loaded messages. Its native list and scroll controller determine which messages are visible and whether new content follows the tail. flowchart TD
A[Conversation picker] --> B[Selected conversation and history]
B --> C[Chat timeline]
C --> D{Session or generation changed}
D -->|Yes| E[Replace native list and positioner]
D -->|No| F[Update existing list]
E --> G[Visible messages and tail following]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Restore reliable cached-conversation tail visibility through a demonstrated lifecycle repair while preserving virtualization, row-targeted navigation, streaming follow and reader scroll-away position. Do we have a high-confidence way to reproduce the issue? Yes, the supplied guarded Release A/B/A scenario provides a concrete reproduction path and repeated candidate failures; this read-only review did not execute it on current main. Is this the best way to solve the issue? No. The isolated session-key change performed worse in the reported controlled application comparison, so mounted identity checks cannot justify this approach. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 07830aa5a9be. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Related: #1437. Follow-up context: #1424.
Status: rejected candidate, investigation continues
Do not merge. The one-key candidate at
4101ee5d21e0cfbe031e4956fe4ca10b27598003performed worse in the controlled, guarded real-application comparison. It is not a verified fix. Earlier mounted-host passes and clean source review are insufficient and do not override these results.What Problem This Solves
The target bug is returning to a populated conversation and seeing its first messages instead of the previously visible tail. The bug predates this patch; no known-good version or introducing commit has been established, so it is not yet a confirmed regression window.
Latest real behavior proof
Predeclared budget: five sequential non-Dev Release runs per arm, alternating A/B. Both used the same unchanged
GatewayFixtureUiTests.SessionPickerSwitchesRealHistoriesAndShowsMessage240AtBothWidthstest, scenario, natural message-240 assertion and timeout. There was no manual scrolling before the natural-tail gate and no retry-until-green.afc3e9f7e616bde264ed78490e6738d0c1bbbd444101ee5dAll five B failures followed the first A selection and subsequent B history request. The unchanged test only selects B after the first A natural-tail assertion passes. The failure is therefore on return to the cached long conversation, not its first selection.
The comparison used separate short-path owned worktrees and normal self-contained Windows App SDK app outputs. Each run's actually loaded
Microsoft.UI.Xaml.dllandMicrosoft.UI.Xaml.Controls.dllpaths and SHA-256 hashes matched that arm's output. Both used the same native binaries:B241F72BFC9460E823D8A122FBDBC2E2D7AC6BA60B9E5BF981E9B5054D4555B5BFB7EE4E86F00B9365FA50DECA8D30BF32C71ACAA536779D20DCF17AE32EC725Both runtime configurations retained
OpenClaw.GatewayFixtureIsolationVersion=1andSystem.Diagnostics.Debugger.IsSupported=false. This is explicitly combined harness+candidate proof, not an untouched fix-PR-head full-app run. Neither PR base was changed and the combined overlay was not pushed.Every outcome, screenshot, Gateway trace, binary/runtime hash and exact command is retained under the coordinating session's
fixture-comparisonartifacts (contract.json,provenance.json,results.json, anda1throughb5). These identifiers refer to retained local artifacts, not public download links. Earlier MAX_PATH build failures are separate setup evidence and did not consume or alter the five UI runs per arm.Why the original candidate is being withdrawn
The candidate keyed the outer ItemsView/scroll-controller decorator by session and timeline generation. The controlled real-app results reject the apparent improvement from the exploratory mounted tests. Next work is bounded to comparable Request/Update/mount/disposal tracing in the actual guarded application before proposing another product change.
The exploratory VSTest host also exposed independent initialization and runtime mismatches, including loading installed 2.5.1 native binaries instead of the app's bundled 2.4.0 payload. Those experiments and their failures are preserved separately. They are not evidence that the product bug is fixed, and speculative controller/test-host/runtime workarounds are not being folded into the landing patch.
Required proof pools
windows-winui-interactive: populated-session return, actual final-message visibility, native lifetime, streaming and scroll-away behavior.Validation
Historical validation of head
4101ee5d, before the decisive comparison:.\build.ps1: passed, all five projects and documentation gate.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,984 passed, 32 skipped.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,978 passed.These results do not make the current candidate merge-ready. The unchanged real-app natural-tail gate is the decisive failed check.
Security and scope
The fixture guards remained enabled. No installed pairings, credentials, autostart, toast registration, WSL Gateway or default MCP port were touched. No parent-checkout edits and no merge were performed. The separately published harness is #1439 (feat: explore and test the app without a live Gateway); its assertion is unchanged.
Fixes: #1437