openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

Chat tail-scroll controller spins the UI thread at 100% CPU on layout changes

Open matoulaile opened this issue 2 months ago • 10 comments

Summary

The chat timeline's tail-scroll controller enters an unbounded self-referential layout loop. LayoutUpdated calls StartBringItemIntoView, which itself causes a layout pass, which re-raises LayoutUpdated. The only brake is a version check that is not invalidated while the chat view stays loaded, so the UI thread spins forever and the app becomes fully unresponsive.

This is not a slow-render or heavy-load issue. A single qualifying event is enough.

  • Windows reports AppHangB1 (stopped interacting with Windows)
  • UI thread at 71.2s CPU while every other thread stayed under 6s
  • Working set grew 230 MB -> 999.9 MB during the hang
  • Reproduced on a freshly restarted process within ~27 minutes of uptime

Affected build / environment

App OpenClaw Companion (OpenClaw.Tray.WinUI.exe) 2026.9.4.0
OS Windows 11 25H2, build 26200.9550
Runtime .NET 10.0.12, win-x64, self-contained

Root cause

src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs

The loop closes

// line 181
private void OnLayoutUpdated(object? sender, object args)
{
    DetachLayout();
    ...
    itemsView.DispatcherQueue.TryEnqueue(() =>
    {
        if (_disposed || !_valid || !itemsView.IsLoaded || version != _version
            || itemsView.ScrollView is not { IsLoaded: true })
        {
            if (!_disposed && _valid)
                AwaitLayout();          // re-arms LayoutUpdated
            return;
        }

        AttachScrollView();
        if (!StartTailRequest(request) && !_disposed && _valid)   // line 205
            AwaitLayout();                                        // never reached, see below
    });
}

// line 254
private bool StartTailRequest(TailNavigationRequest request)
{
    ...
    _following = true;
    itemsView.StartBringItemIntoView(request.Index, new BringIntoViewOptions   // line 269
    {
        AnimationDesired = false,
        VerticalAlignmentRatio = 1.0,
    });
    return true;      // line 274 -- always true on the success path
}
  1. LayoutUpdated fires.
  2. StartTailRequest calls StartBringItemIntoView (line 269).
  3. BringIntoView itself triggers a layout pass, re-raising LayoutUpdated.
  4. Goto 1. Repeat.

StartTailRequest returns true whenever it gets past the guards, so the AwaitLayout() fallback at line 205 is unreachable on that path. The only exit is the version != _version check at line 196, and _version is only incremented in OnUnloaded (line 282). While the chat view remains loaded, that exit never triggers.

Every iteration allocates a fresh BringIntoViewOptions, which is what drives the 4x memory growth.

Stack trace (symbolized from a live dump)

Captured with procdump -ma on the hung process and resolved with dotnet-dump against the PDBs shipped alongside the binary. This is the actual stack at hang time, not inference.

OS Thread Id: 0x58d4
  ABI.Microsoft.UI.Xaml.Controls.IItemsViewMethods.StartBringItemIntoView(
      WinRT.IObjectReference, Int32, Microsoft.UI.Xaml.BringIntoViewOptions)
      index = 0x0000000000000060        (96)
  Microsoft.UI.Xaml.Controls.ItemsView.StartBringItemIntoView(Int32, BringIntoViewOptions)
  OpenClawTray.Chat.<...InitialTailPositioner>.StartTailRequest(TailNavigationRequest)
      [...\src\OpenClaw.Tray.WinUI\Chat\ReactorItemsViewScrollController.cs @ 269]
  OpenClawTray.Chat.<...InitialTailPositioner>+<>c__DisplayClass20_0.<OnLayoutUpdated>b__0()
      [...\src\OpenClaw.Tray.WinUI\Chat\ReactorItemsViewScrollController.cs @ 205]
  ABI.Microsoft.UI.Dispatching.DispatcherQueueHandler.Do_Abi_Invoke(IntPtr)   <-- UI thread
  Microsoft.WinUI!ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(...)
  OpenClawTray.Program.Main(System.String[])

Full dump available on request (1011 MB, PID 16712).

Trigger in practice

Any burst of layout changes in the chat timeline. The most common source is the gateway broadcasting sessions.changed, which rebuilds the session and chat lists. Three events inside a single millisecond immediately preceded this hang:

15:36:07.162  [INFO] [EVENT] Received event: sessions.changed
15:36:07.163  [INFO] [EVENT] sessions.changed received - refreshing sessions list
15:36:07.164  [INFO] [EVENT] Received event: sessions.changed
15:36:07.165  [INFO] [EVENT] sessions.changed received - refreshing sessions list
15:36:07.165  [INFO] [EVENT] Received event: sessions.changed
15:36:07.165  [INFO] [EVENT] sessions.changed received - refreshing sessions list

Process state at capture: Responding=False, 54 threads, 999.9 MB, UI thread 71.2s CPU.

Suggested direction

Not a prescribed patch, just the constraints a fix needs to satisfy:

  1. Stop re-entering on the layout caused by our own scroll. Track whether a BringIntoView is in flight and ignore LayoutUpdated until it completes, instead of relying on a version counter that only changes on unload.
  2. Make the guard at line 196 actually reachable, or remove it if it is not load-bearing. Today StartTailRequest's unconditional true makes the AwaitLayout() branch at line 205 dead code.
  3. Bound the retry. AwaitLayout() re-arming on every failed attempt is the other half of the loop. A cap or a coalescing queue would bound it even if the scroll path is wrong.
  4. The project already references System.Threading.Channels, and the existing _tailNavigationQueue / QueueTailRequest path (line 230) looks like the intended coalescing point. Worth checking whether the LayoutUpdated path (line 194) bypasses it.

Impact

Any user running an agent that emits tool calls while the chat window is open. The process must be killed; the session data survives but the UI is unusable until restart. Recovering UI resources also requires a restart (see #1567 for the leaked popup windows).

Required proof pools

  • UI (chat)

Real behavior proof

Hung-process dump plus the symbolized UI-thread stack above, captured from the shipped 2026.9.4.0 binary using its own PDBs.

Validation

Report, not a code change. Stack trace produced from a live dump of the hung process.

matoulaile avatar Oct 01 '26 08:10 matoulaile

Codex review: this still needs some work.

Summary Keep open: main replaces the original blocked navigation call, but complete resolution is unverified and an open closing PR still owns this issue.

Reproducibility: Historical released-build stacks and a contributor's synthetic tall-row reproducer establish a concrete failure, but this review did not reproduce current main; WinApp is unavailable on this host and no builds or tests were run.

Root-cause cluster Relationship: canonical Canonical: https://github.com/openclaw/openclaw-windows-node/issues/1568 Summary: This issue owns the corroborated native tail-navigation hang, with one closing candidate and one overlapping navigation repair.

Members:

  • duplicate: https://github.com/openclaw/openclaw-windows-node/issues/1167 - Independent restoration dumps show the same blocked InitialTailPositioner-to-ItemsView navigation path and were explicitly consolidated here.
  • fixed_by_candidate: https://github.com/openclaw/openclaw-windows-node/pull/1935 - The open PR explicitly closes this issue and supplies the minimized tall-row regression, with incomplete full-app acceptance.
  • partial_overlap: https://github.com/openclaw/openclaw-windows-node/pull/2083 - The open draft addresses the same navigation boundary plus distinct completion and transient-realization cases.

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

Next step Reconcile the existing candidates, validate tall-history restoration and reader retention on current main, distinguish the newer lag report with sanitized stack evidence, and provide a visible recovery launcher for frozen startup.

Review details

Best possible solution:

Complete the existing navigation repair with current-build native acceptance evidence and provide a visible recovery launcher for startup hangs.

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

Historical released-build stacks and a contributor's synthetic tall-row reproducer establish a concrete failure, but this review did not reproduce current main; WinApp is unavailable on this host and no builds or tests were run.

Is this the best way to solve the issue?

Avoiding synchronous ItemsView navigation addresses the captured boundary, whereas debounce alone cannot release an already-blocked native call; completion still requires replaying the exact trigger and lifecycle cases against current main.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • Current-main tall-row restoration, route-return visibility, and reader retention have not been demonstrated together.
  • The v2026.11.3 performance report may have a different cause from the historical blocked native call.
  • The two open candidates require reconciliation against the existing scrolling owner before their remaining work can be determined.

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

Label changes

Label changes:

No label changes.

Label justifications:

  • P0: Reported automatic history restoration can freeze the entire application and leave ordinary users without an in-product recovery path.
  • impact:crash-loop: Independent released-build reports establish sustained UI-thread hangs requiring process termination.
  • impact:ux-release-blocker: Startup restoration can make chat and Settings unreachable; reported recovery requires external process control or configuration changes.
Evidence reviewed

What I checked:

  • Open closing PR requires retention: REST confirms https://github.com/openclaw/openclaw-windows-node/pull/1935 (fix(chat): chat freezes when opening tall message history) remains open and unmerged, with an explicit closing reference to this issue.
  • Current main replaces the blocked API: StartTailRequest realizes through ItemsRepeater, observes stable geometry within a frame budget, revalidates identity and generation, and dispatches an element StartBringIntoView call. (src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs:938, a0a2a24ec1dd)
  • Merged replacement provenance: REST verifies merged https://github.com/openclaw/openclaw-windows-node/pull/2093 (improve(chat): align native conversation and tool activity with web); its commit patch removes ItemsView.StartBringItemIntoView and adds staged realization and direct element navigation. (src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs, 243f9cff53d8)
  • Existing protection and acceptance routes: The source guard forbids synchronous ItemsView navigation and forced layout; separate shipped-app fixture tests exercise repeated session switching and final-message visibility at two widths. These tests were inspected, not executed. (tests/OpenClaw.Tray.Tests/ChatTimelinePresentationTests.cs:238, a0a2a24ec1dd)
  • Candidate proof remains incomplete: DragonLi-Mi reports native-root tall-history passes, but full-app route-return clipping and unproven reader retention remain. A later comment says retained-history replay also passed on the original installed build, preventing attribution of that pass to the repair.
  • Overlapping candidate retains distinct work: https://github.com/openclaw/openclaw-windows-node/pull/2083 (fix(chat): switching conversations can land on old messages or freeze the chat) remains an open draft covering transient realization, native completion handling, and landing confirmation beyond the replacement already on main.
How this review workflow works
  • 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; those execution lanes are retired.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Reviewed November 17, 2026, 3:26 AM ET / 08:26 UTC.

clawsweeper[bot] avatar Oct 01 '26 08:10 clawsweeper[bot]

Additional reproduction on 2026.9.4 (startup / restored chat)

I reproduced what appears to be the same native-chat UI-thread failure on the current installed Windows Companion, with a healthy local Gateway.

Environment

  • Windows 11 Pro 10.0.26200, x64
  • Companion 2026.9.4+3c43751b2bace876de3febe478ebabeca172e3ac
  • Gateway 2026.9.8 (fc23bc8), loopback ws://127.0.0.1:18789
  • 41 existing sessions; models.list returned 21 models

Observed sequence

  1. Companion had started in tray mode and connected to the Gateway, but no visible window appeared. The process reported Responding=True with MainWindowHandle=0; enumerating its top-level windows showed OpenClaw Chat existed but was Visible=False.
  2. Repeated openclaw://chat activations were received and logged (Handling deep link) but did not make the existing chat window visible.
  3. After terminating that instance and cold-starting the executable with openclaw://chat, a real main window was created (MainWindowTitle=OpenClaw Companion, nonzero handle).
  4. Once the operator connection completed and the native chat restored state/catalog data, the window became permanently unresponsive. Gateway health/tick traffic continued normally. The process reached about 65 seconds of CPU and ~257 MB working set within roughly two minutes.
  5. A cold start with openclaw://commandcenter remained responsive (Responding=True, ~2 seconds CPU), isolating the problem to the chat surface rather than general startup, pairing, or Gateway connectivity.

The relevant log boundary was:

[ChatBridge] OnModelsListUpdated: count=21
Wizard response payload kind=Object len=27626
Node status: Connected

There was no matching Gateway failure; openclaw health --json returned ok: true with all 20 plugins loaded and no plugin errors.

A/B workaround confirmation

Changing only this setting and restarting with openclaw://chat recovered the app:

"UseLegacyWebChat": true

After 22 seconds the same Companion was connected, visibly open, and responsive (Responding=True, ~3.8 seconds CPU, nonzero main-window handle). No sessions, credentials, or Gateway settings were changed.

This corroborates the native timeline/tail-positioning path as the failure boundary. It also explains why ordinary monitoring can misdiagnose the initial state: Responding=True is not meaningful when MainWindowHandle=0.

I did not attach a full dump because it may contain session/auth data. I can collect a redacted current-process stack if maintainers need confirmation against InitialTailPositioner.StartTailRequest -> ItemsView.StartBringItemIntoView.

Bcobas avatar Oct 07 '26 07:10 Bcobas

Reproduction on Windows Companion 2026.9.8.0

Hit the same UI hang in 2026.9.8 (the build running on my machine today) with the Application Hang 1002 trace below. Posting here to confirm the fix is still needed against the latest release, not just 2026.9.4.

Environment

  • Windows 11 (eDMateXPro, Tailscale-attached)
  • Companion 2026.9.8.0 (OpenClaw.Tray.WinUI.exe)
  • Mac mini Gateway 2026.9.4 (loopback via Tailscale)

Application Hang events (Event Viewer)

Time PID Event Source
2026-10-08 18:39:31 29764 1002 Application Hang
2026-10-08 17:23:13 18316 1002 Application Hang
2026-10-03 23:10:55 15076 1002 Application Hang
2026-10-02 00:26:55 18048 1002 Application Hang

The 18:39:31 entry is the moment the chat window went "not responding" in the title bar. The hang reproduces on 9.8, not just 9.4.

Companion tray log, around 18:39:31

[18:39:14] session.message
[18:39:15] chat (chat.history request, final user prompt)
[18:39:16] agent run_status / assistant stream
[18:39:18] agent stream=item
[18:39:19] chat history response (100940 B)
[18:39:19] assistant final 726 B
[18:39:19] ActivityStream notification
(no further log lines after this — UI thread deadlocked)

The 18:39:19 line is the last entry before Application Hang 1002 fired at 18:39:31 (~12 s later, consistent with the 5 s "not responding" threshold plus OS retry). Network/receive threads kept logging until the OS killed the process — matches the tail-scroll controller loop described in the issue body.

Workaround

Stop-Process -Name "OpenClaw.Tray.WinUI" -Force

Process has to be relaunched from the Start Menu; it cannot recover on its own.

Happy to capture a procdump -ma on the next hang if that helps.

edisonxl avatar Oct 08 '26 11:10 edisonxl

Still reproduces on 2026.9.8-1 against Gateway 2026.10.5 (Windows 11).

Hang dump (ProcDump -h, 23 Oct 2026): the UI thread is blocked in Microsoft.UI.Xaml.Controls.ItemsView.StartBringItemIntoView, called from ReactorItemsViewScrollController → InitialTailPositioner.StartTailRequest, dispatched via DispatcherQueueHandler. Windows logs AppHangB1.

The code path is unchanged on main (f5978f0).

Coalescing sessions.changed refreshes (see #1569) made the hang rarer but did not stop it.

Can share the managed stack on request.

diskawrs avatar Oct 23 '26 00:10 diskawrs

Reproduction on 2026.9.8.0 (deterministic at every launch) + evidence that the re-arm loop is not the only problem

Environment: Windows 11, Companion 2026.9.8-1 (file version 2026.9.8.0), Gateway 2026.10.6, managed local gateway, native chat (UseLegacyWebChat=false), no SSH tunnel.

Symptom: every launch hangs within ~2 s of the node handshake completing. The window is created and visible (1280x860, Visible=True), but Responding=False. Windows logs AppHangB1: 5 events — 2026-10-27 19:04, 2026-10-28 09:44, 09:45, 09:49, 11:05. At 90 s wall the UI thread had burned 101 s CPU (~100% of one core) while every other thread stayed flat; the log keeps writing from background threads (gateway health, node ticks), so this is UI-thread-only.

Managed stack (dotnet-dump collect --type Full, SOS clrstack -all):

Microsoft.UI.Xaml.Controls.ItemsView.StartBringItemIntoView(...)
  ABI.Microsoft.UI.Xaml.Controls.IItemsViewMethods.StartBringItemIntoView
  OpenClawTray.Chat.<ReactorItemsViewScrollController>...__InitialTailPositioner.StartTailRequest
      Chat/ReactorItemsViewScrollController.cs @ 269
  <>c__DisplayClass20_0.<OnLayoutUpdated>b__0        @ 205
  ABI.Microsoft.UI.Dispatching.DispatcherQueueHandler.Do_Abi_Invoke
  Microsoft.UI.Xaml.Application.Start -> OpenClawTray.Program.Main

New data point: does StartBringItemIntoView return?

The review asked for this. I patched InitialTailPositioner.OnLayoutUpdated to run at most 8 times (a guard on the re-arm path, leaving StartTailRequest untouched), shipped it and restarted: the UI thread still sat at 97% and the window stayed unresponsive.

So the managed LayoutUpdated -> re-arm loop alone does not explain the hang: a single StartBringItemIntoView invocation does not return (or returns only once XAML aborts the layout cycle). That is worth knowing before choosing a repair — a fix that only debounces/limits the re-arm will not help.

Mitigations I verified on the shipped binary (no source change)

Change Result
UseLegacyWebChat: true App usable, legacy web chat surface
StartTailRequest body -> return false; (never call StartBringItemIntoView) Starts fine, Responding=True, idle CPU ~0%, no AppHang. Cost: no auto-scroll to newest message
StartTailRequest body -> ScrollView.ScrollTo(0, ScrollableHeight) Unblocks, but raises LayoutCycleException (caught by the app's unhandled-exception handler; chat pane sometimes renders blank), so I would not ship it

A source-level fix should probably stop using StartBringItemIntoView for tail positioning entirely (or defer it until the item container is realized and bounded), rather than trying to make the loop converge.

I can share the full dump (705 MB), the exact IL patch, or the AppHang event export if useful.

168062576-tech avatar Oct 28 '26 04:10 168062576-tech

Additional live reproduction on OpenClaw Companion 2026.9.8-1, installed source revision 2ba89f377ce8ce3f5ddfc452e4d509329f109114.

Observed behavior

  • Windows repeatedly reports the client as not responding.
  • The process consumes approximately 98-100% of one logical CPU core.
  • Three independently collected live managed stacks stop at the same UI-thread call:
ABI.Microsoft.UI.Xaml.Controls.IItemsViewMethods.StartBringItemIntoView(...)
Microsoft.UI.Xaml.Controls.ItemsView.StartBringItemIntoView(...)
OpenClawTray.Chat.InitialTailPositioner.StartTailRequest(...)
OpenClawTray.Chat.InitialTailPositioner.<OnLayoutUpdated>b__0()
ABI.Microsoft.UI.Dispatching.DispatcherQueueHandler.Do_Abi_Invoke(...)
Microsoft.UI.Xaml.Application.Start(...)
OpenClawTray.Program.Main(...)

Compiler-generated type names are shortened here. No application memory dump, chat content, credentials, or raw protocol logs are attached.

The Gateway remains healthy independently of the frozen UI: /healthz returns HTTP 200 with status=live, and /readyz returns HTTP 200 with ready=true, coreReady=true, and eventLoop.degraded=false. Requests from both Windows and the WSL Gateway environment complete in approximately 4-11 ms. The client's existing Gateway connections remain established.

Source cross-check and remaining uncertainty

The installed revision calls StartBringItemIntoView synchronously from the UI dispatcher in ReactorItemsViewScrollController.cs:269. This matches the captured stacks directly.

However, the explanation of a simple LayoutUpdated -> scroll -> LayoutUpdated application-event loop needs qualification:

  • OnLayoutUpdated calls DetachLayout() before enqueueing the scroll callback.
  • Request() also increments _version, not only OnUnloaded().
  • TailNavigationPolicy.CanExecute already checks the queued target's bounds and identity.

The live stacks establish the blocked scroll path, but do not by themselves prove an application-handler recursion or an invalid index. A native WinUI layout/navigation problem, or an unsafe interaction between tail positioning and layout state, still needs to be distinguished with an isolated reproduction.

I am investigating the client repository and a focused regression/fix. No fix is claimed or validated yet.

DragonLi-Mi avatar Oct 30 '26 02:10 DragonLi-Mi

Fix proposed in #1935: https://github.com/openclaw/openclaw-windows-node/pull/1935

The native production-root regression reproduces the UI-thread hang inside synchronous ItemsView.StartBringItemIntoView when navigating past a tall, virtualized assistant message. This is a Windows chat scrolling defect, not a Gateway responsiveness failure. The evidence does not establish a managed LayoutUpdated recursion.

The fix uses low-priority dispatch and asynchronous native-element bring-into-view, preserves exact native target geometry and anchor lifetime, and rebinds an unfinished request when Reactor recycles its target container. Existing tail-generation checks, lifecycle cleanup, and the user's scroll-up position remain intact.

Validation for commit b98c89bcee5249177c4dc564064f4828a0ae7425:

  • Full production build passed.
  • Shared: 4,807 passed, 25 existing skips; Tray: 4,763 passed, no skips.
  • Selected native regression/lifecycle/root checks: 19 passed, no skips.
  • Five tail-regression cases passed again in a fresh process, then five passed after rebuilding the clean committed head.
  • The native cases cover narrow/wide history, append, remount, preserving scroll-up, and an explicit history-revision jump.
  • GPT-6 Astra Standards review: no significant issues. Spec review: no significant issues.

Proof boundaries: native execution used the currently installed WinUI runtime (Microsoft.UI.Xaml.dll 3.3.0.0). This does not claim validation against the original installed client's 3.2 runtime, a live Gateway/provider replay, or the complete windows-winui-interactive maintainer pool. The original installed client and its profile were not replaced, restarted, or modified.

DragonLi-Mi avatar Oct 30 '26 05:10 DragonLi-Mi

Additional answers to the review's native-navigation questions and the corroborating reports above:

Deterministic trigger: the minimized native regression is now in PR #1935 (fix(chat): chat freezes when opening tall message history), in HistoryTail_ScrollsPastTallMessageWithoutBlockingUi. It uses 16 synthetic mixed-role messages: index 5 has 50 paragraphs of 40 CJK characters plus a 10-row table; the newest row is separated from that tall row and initially unrealized. Thus the reproducer does not require sharing a user's conversation or full dump. The pinned development base is 4cbbe51c45a7653e75ecf7d85481d7014b7e374b, not a claim that today's upstream main was freshly reproduced.

Return versus re-arm: in the baseline native reproduction, UI-thread progress stopped at the synchronous ItemsView.StartBringItemIntoView boundary and an external watchdog was required. Together with the repeated released-process stack samples, this supports treating a blocked synchronous navigation call as the repair boundary. It does not prove an unconditional managed LayoutUpdated recursion or a particular internal WinUI defect. A debounce/re-arm cap alone cannot make an already-blocked native call yield, consistent with the earlier eight-entry-cap report.

Why not just scroll to ScrollableHeight or disable positioning: disabling navigation drops the tail-follow behavior. Using the current estimated total extent is not proof that the unrealized last item's actual bounds are visible, and the reported layout-cycle result makes that unsuitable as a demonstrated replacement. The PR instead uses asynchronous native target geometry, completion/anchor ownership and rebinding when an unfinished target is recycled.

Dump requests / responsiveness: the sanitized stack and synthetic reproducer are sufficient for this regression; I am not requesting anyone's full memory dump, which can contain conversation and authentication data. As Bcobas noted, Responding=True without a visible chat window is not acceptance evidence. The follow-up therefore inspected the actual full-process window and the final text marker's bounds, not only the process flag.

Honest current status: the full-app fixture now demonstrates initial 240-message tail visibility, streamed append follow and session reselection on the PR head, using a synthetic Gateway and isolated profile. However, Notifications > Back still clipped the streamed final answer, and reader scroll-up retention has not been demonstrated in the full app. The exact 16-message trigger is still native-root test-host proof only. The PR's Real Behavior Proof records these gaps; this issue should not be considered verified fixed or ready to close from those partial results. A visible out-of-process recovery launcher is not implemented by this focused fix.

DragonLi-Mi avatar Oct 30 '26 06:10 DragonLi-Mi

Consolidating the sustained native-chat UI-thread hang from #1167 here so one open issue owns this failure. This is duplicate cleanup, not a claim that the hang is fixed.

The strongest shared evidence is the same blocked UI-thread path, InitialTailPositioner.StartTailRequest -> ItemsView.StartBringItemIntoView, with the Gateway still healthy. #1167 supplies independent startup/reconnect dumps and valid-tail evidence: https://github.com/openclaw/openclaw-windows-node/issues/1167#issuecomment-5543591128 and https://github.com/openclaw/openclaw-windows-node/issues/1167#issuecomment-5645239747. Its later v2026.9.8-1 report records 886,583 bytes of restored history and sustained single-core saturation: https://github.com/openclaw/openclaw-windows-node/issues/1167#issuecomment-6113641601.

Keep the original approximately 200-message session-switch scenario and automatic startup/reconnect restoration as acceptance cases. Also retain the separate invalid-anchor crash investigation (https://github.com/openclaw/openclaw-windows-node/issues/1167#issuecomment-5647075810) and returned-but-mispositioned scroll evidence (https://github.com/openclaw/openclaw-windows-node/issues/1167#issuecomment-6352852481) as distinct observations, not proof that every crash shares the hang mechanism. The reported 200-message count is not an established threshold, and neither initial history projection nor an unconditional managed LayoutUpdated recursion is a verified root cause.

#1935 (fix(chat): chat freezes when opening tall message history) already closes this issue; #2083 (fix(chat): switching conversations can land on old messages or freeze the chat) overlaps. Current main has already replaced the old synchronous navigation call, so reconcile those candidates and validate current-build native restoration, tall-history navigation, final-row visibility, route return and reader-position preservation before closing as fixed. Preserve conversation data; do not request public full dumps or require a reset.

roboclaw-bot avatar Nov 10 '26 20:11 roboclaw-bot

Same-class regression on 2026.11.3 — chat UI degrades within ~15–50 min of uptime; only a process restart recovers

Reproduced on a build newer than the reports above (2026.9.4 / 2026.9.8). All figures measured on 2026-11-17 with Get-Counter "\Process(OpenClaw.Tray.WinUI)\% Processor Time" (3-second samples).

Environment

  • App: OpenClaw.Tray.WinUI.exe 2026.11.3+66b9b5a559a0651da3aa6ce7ae3d183fbd87cb1c (binary dated 2026-11-16)
  • Windows 11, AMD Ryzen 5 9500F (6-core), 23.6 GB RAM (8 GB free)
  • Dual GPU: RTX 5070 + RX 6500 XT; desktop composited on the 6500 XT; per-app GPU preference for the companion explicitly set to the 6500 XT (no behavioral change)
  • Hardware-accelerated GPU scheduling is on (Settings toggle on; HwSchMode=2 in registry, which on current Win11 maps to "request on" — consistent, no anomaly)
  • Remote-desktop client (Sunlogin/AweSun) with its OrayIddDriver virtual display present — quitting it did not fix the lag, so it is not the cause (it does add an extra composited virtual surface)

Timeline

  1. Instance A (started 13:59). At ~50 min uptime, repeated idle samples: 25.9% / 23.9% / 26.4% of one core with no input; working set grown to 633 MB (fresh instances sit at ~431 MB); dwm (composition) at 38.4% simultaneously vs ~10% when the client is quiet; cumulative CPU ≈ 1020 s in the first hour (~⅓ core sustained on average). User-visible symptom: noticeable input lag in the chat box; no AppHangB1, app stays responsive.
  2. Instance B (restarted ~14:55 after quitting both the client and AweSun). Healthy right after start, then while a long message was streaming into the open chat window, samples climbed 32.2 → 36.2 → 29.6 → 41.0%, back to 0% after the stream ended. User-laggy again by ~15:10.
  3. Controls performed while laggy: quit AweSun → still laggy; set per-app GPU preference to the 6500 XT → still laggy; restart the companion → smooth immediately.
  4. Instance C (started 15:12:40, AweSun off): repeated idle samples 0% / 0% / 0%, 431 MB, smooth.

Notes

  • The spin here does not saturate the UI thread (plateaus at 24–41% of one core) but is enough to make typing feel laggy — possibly a partially-braked variant of the same layout loop, or a sibling layout path (e.g. streaming-token reflow) that bypasses the _tailNavigationQueue coalescing.
  • The machine is not the constraint: overall CPU ~16%, ample RAM and disk headroom.

Happy to capture a process dump + symbolized UI-thread stack against this build when it degrades next — let me know if that would help.

Keanu-L avatar Nov 17 '26 07:11 Keanu-L