Skip to content

improve(chat): remove an unnecessary wait when opening chat history - #1449

Open
dotMorten wants to merge 1 commit into
openclaw:mainfrom
dotMorten:user/dotmorten/scroll_fix
Open

dotMorten wants to merge 1 commit into
openclaw:mainfrom
dotMorten:user/dotmorten/scroll_fix

Conversation

@dotMorten

@dotMorten dotMorten commented Sep 19, 2026

Copy link
Copy Markdown

What Problem This Solves

Opening or switching chat histories can leave the initial scroll request waiting for another layout event even though the chat view is already loaded.

User Impact

User impact: initial scrolling toward the latest message no longer requires an additional layout event after the view loads. This change does not guarantee successful tail positioning or fix the existing native ItemsView invalid-anchor crash.

Why This Change Was Made

The native bring-into-view request handles target realization and layout. Waiting for an unrelated future LayoutUpdated notification adds an unnecessary prerequisite.

InitialTailPositioner remains the owner. It waits for the ItemsView and ScrollView to load, then retains the existing dispatcher handoff so navigation runs outside Reactor reconciliation. Request-generation and tail-identity checks, unload/disposal cleanup, and streaming follow behavior remain in place. The source-contract tests now guard the load-only flow and prohibit reintroducing the layout-event subscription.

No Reactor package upgrade, local Reactor patch, ScrollTo workaround, or debugger-startup change is included.

Evidence

Actual OpenClaw was exercised with two synthetic 77-message histories. That experiment reproduced the original invalid-anchor crash on the first session switch, rather than proving this change fixes it. The full native dump resolved to:

ItemsView::OnScrollViewAnchorRequested (ItemsView.cpp:972)
  -> ScrollingAnchorRequestedEventArgs::AnchorElement
     (ScrollingAnchorRequestedEventArgs.cpp:43)
  -> E_INVALIDARG (0x80070057), surfaced as 0xC000027B

Pre-publication rubber-duck review of the committed two-file change found no actionable issues. The bundled Codex autoreview command was also attempted but could not run because the Codex CLI is not installed; that tool is not being reported as passed.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: initial chat-history scrolling, session switching, and native ItemsView behavior require an interactive Windows app.
  • windows-11-arm64: native ARM64 build and runtime crash investigation were performed.

Validation

Command Result
.\build.ps1 -Configuration Release Passed, including the WinUI ARM64 build
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj 3,983 passed, 33 skipped, 0 failed
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj 2,980 passed, 0 failed

The first test runs restored packages because this was a fresh worktree. Repository-root discovery and tray settings were isolated. The tests include ReactorTimeline_UsesStableBottomAnchoringAndDiscreteTailRequests and ReactorTimeline_InitialTailWaitsForLoadWithoutLayoutSubscription; these are source-contract checks, not proof that native scrolling always completes.

Real Behavior Proof

  • Environment tested: native Windows ARM64, Release/non-DevBuild OpenClaw, isolated tray data, synthetic loopback WebSocket gateway. Loaded DLL hashes matched the restored packages; no locally patched Reactor was used.
  • PR head or commit tested: f683edcae3b4405316149980b78a28ea5f49291f, with the explicitly noted temporary package/Markdown compatibility overlay. The committed scroll controller was unchanged.
  • Exact steps or command run: launch the actual OpenClaw chat window, load a synthetic 77-message mixed-height history, then use Sessions > Open in chat to switch from "Workaround two" to "Workaround one". The UI driver requested 20 switches and stopped on the first crash; it did not repair the scroll position.
  • Evidence after fix: the initial chat viewport was blank with the final marker offscreen. The second history request was received, followed by the native exception shown above. The driver recorded completedSwitches: 0, processAlive: false, and two history responses.
  • Observed result: the original invalid-anchor crash still reproduces. Removing the layout wait is not sufficient to prevent it. This is a negative diagnostic result, not successful tail-positioning or crash-free runtime proof.
  • Screenshot or artifact links verified? N/A. The relevant native diagnostic output is copied above; the local screenshot and full dump are not publicly uploaded.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation: N/A.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No
  • If yes, list the exact upgrade steps: N/A.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown

🦞👀
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.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 18, 2026, 8:42 PM ET / September 19, 2026, 00:42 UTC (Revision 2).

ClawSweeper review

What this changes

Removes the extra layout-event wait before Windows chat history requests scrolling to the latest message and updates the source-contract tests.

Merge readiness

Blocked before merge - 3 items remain

Keep open: the change remains distinct from current main, and no concrete introduced defect was found. The supplied native run provides useful negative diagnostics but does not demonstrate the intended improvement.

Priority: P2
Reviewed head: f683edcae3b4405316149980b78a28ea5f49291f

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no identified blocking code defect, but its honest negative runtime evidence does not satisfy the behavior-proof gate.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The ARM64 real-app run exercised InitialTailPositioner through history loading and session switching, but its compatibility overlay, blank viewport, and existing crash do not demonstrate improved navigation on the committed dependencies. Positive native UI or diagnostic evidence is still needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The ARM64 real-app run exercised InitialTailPositioner through history loading and session switching, but its compatibility overlay, blank viewport, and existing crash do not demonstrate improved navigation on the committed dependencies. Positive native UI or diagnostic evidence is still needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Introduced change and lifecycle: The pinned delta changes only the scroll controller and its source-contract tests. The controller retains dispatcher handoff, request-generation checks, tail-identity validation, and unload/disposal cleanup while removing LayoutUpdated subscriptions.
Still necessary on main and latest release: GitHub returned the supplied main SHA. Both that revision and v2026.9.4 retain AwaitLayout and the LayoutUpdated subscription, so neither already contains this improvement.
Production caller and dependency boundary: The production timeline supplies session/generation/history-revision request keys and the final row identity to this controller. The committed project pins both Reactor packages to preview.12; the PR's temporary package/Markdown overlay therefore matters to interpreting native behavior.
Findings None None.
Security None None.

How this fits together

The Windows chat timeline turns history and session selections into virtualized message rows. Its scroll controller waits for native controls to load, validates the requested message, and asks WinUI to bring it into view.

flowchart TD
  A[History or session selection] --> B[Virtualized message rows]
  B --> C[Initial scroll controller]
  C --> D{Native controls loaded?}
  D -->|No| E[Wait for load]
  E --> C
  D -->|Yes| F[Dispatch and validate request]
  F --> G[Bring latest message into view]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The ARM64 real-app run exercised InitialTailPositioner through history loading and session switching, but its compatibility overlay, blank viewport, and existing crash do not demonstrate improved navigation on the committed dependencies. Positive native UI or diagnostic evidence is still needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The available native run used a temporary dependency/Markdown overlay, leaving the changed load ordering unverified on the committed preview.12 configuration.
  • Complete next step (P2) - Confirm validation used the unmodified head and committed dependencies, then add positive native proof of the removed wait improving initial navigation. Screenshots or video are preferred for the visible result; copied diagnostics and logs also count. Redact private information. Update the PR body to trigger re-review; if needed, ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep initial navigation in the existing controller, preserving its lifecycle guards and native row targeting, with positive evidence that removing the layout wait improves history opening.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep initial navigation in the existing controller, preserving its lifecycle guards and native row targeting, with positive evidence that removing the layout wait improves history opening.

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

Unclear for an observable native stall: current main demonstrably waits for another layout event, but the supplied run does not isolate that wait as the cause of failed navigation.

Is this the best way to solve the issue?

Yes at the source-design level: this removes a prerequisite within the existing owner without adding a competing scrolling implementation. Native success on the committed dependencies remains unproven.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded chat-history navigation improvement; the existing native crash is explicitly outside its claimed fix.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The ARM64 real-app run exercised InitialTailPositioner through history loading and session switching, but its compatibility overlay, blank viewport, and existing crash do not demonstrate improved navigation on the committed dependencies. Positive native UI or diagnostic evidence is still needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • karkarl: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • bkudiess: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the reported build, Shared tests, and Tray tests cover the unmodified head with committed dependencies.
  • Add redacted native evidence showing initial navigation proceeds without the extra layout event and reaches the intended visible result.

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-19T00:35:17.884Z sha f683edc :: needs real behavior proof before merge. :: none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant