Repository navigation
Description
Summary
OpenClaw Companion v2026.7.1 can become unresponsive when switching to a session whose history load returns approximately 200 messages. The gateway remains healthy while the native WinUI stops updating, and Windows records AppHangB1.
This appears related to synchronous history projection/snapshot rendering, but is distinct from the per-event streaming flood tracked in #1150 and its candidate fix #1158.
Environment
- OpenClaw Companion: v2026.7.1
- Release commit:
4206611f2b2e47cd575e1c8aa94e3e7708f6dd96 - Windows desktop client:
OpenClaw.Tray.WinUI.exe
Reproduction
- Have a session with enough history for the Companion to load the approximately 200-message history window.
- Switch from another session to that session.
- Wait while the history response is projected and the resulting snapshot is rendered.
Reproduced on 2026-08-16 around 12:04 local time.
Actual behavior
- The native WinUI becomes unresponsive or stops visually updating.
- Windows records
AppHangB1. - Gateway health remains OK during the UI hang.
Expected behavior
Switching sessions and loading the bounded history window should remain responsive, including for histories containing many agent/tool events.
Exact-release source path
In the v2026.7.1 source, OpenClawChatDataProvider folds the loaded history (up to 200 messages) into timeline state and publishes the resulting snapshot. The Changed handler in OpenClawReactorChatRoot then calls setSnapshot(args.Snapshot), triggering the native WinUI/React render.
Even though this is one publication rather than the per-event publication storm in #1150, projecting and synchronously rendering a large snapshot immediately after a session switch can saturate the UI thread.
Relevant source:
src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs- the
OpenClawReactorChatRootsnapshotChangedhandler
Why this is not a duplicate of existing reports
- [Bug] OpenClaw.Tray.WinUI v2026.7.1 UI hang/crash (AppHang + APPCRASH combase.dll) under heavy agent event streaming #1150 is the canonical report for UI saturation under a high-rate live agent-event stream. Draft PR fix(tray): bound streaming UI dispatch work #1158 bounds/coalesces those per-event paths, but does not appear to batch the initial history projection/render during a session switch.
- Chat UI virtualization (perf on large conversations) #860 was closed by merged PR Virtualize chat timeline rows #898, which virtualized chat timeline rows. That merge is already an ancestor of v2026.7.1, so this hang reproduced with row virtualization present.
Suggested fix/validation area
- Batch or incrementally project history where practical.
- Avoid a large synchronous full-timeline render on the UI thread after session selection.
- Add a current-head WinUI responsiveness test that switches into a session with 200 varied history messages, including dense agent/tool entries.
- Preserve scroll restoration, selection, and terminal event state while batching.
Crash scope
There was also one separate 2026-08-13 crash involving CoreMessagingXP.dll. There is not enough evidence to attribute that crash to this history-load hang, so this report is limited to the recurring AppHang/UI-saturation behavior.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity
clawsweeper commentedon Aug 16, 2026
Codex review: this still needs some work.
Summary
Keep open: released builds have concrete sustained-hang reports, current main retains the implicated navigation path, and maintainer investigation explicitly finds no verified fix.
Reproducibility: There are credible released-build reproductions and redacted native navigation stacks, but no high-confidence current-main native x64 reproduction; maintainer synthetic runs remained responsive and exposed a separate positioning failure.
Next step
Capture native x64 restoration with verified binaries and redacted navigation entry/return traces, evaluate the existing candidates, and provide visible recovery that preserves conversation history.
Review details
Best possible solution:
Restore responsive history loading and provide visible, conversation-preserving startup recovery while retaining final-row visibility and scrolled-up reader position.
Do we have a high-confidence way to reproduce the issue?
There are credible released-build reproductions and redacted native navigation stacks, but no high-confidence current-main native x64 reproduction; maintainer synthetic runs remained responsive and exposed a separate positioning failure.
Is this the best way to solve the issue?
Batching history projection alone is not established as the fix: dump-derived evidence points downstream to native scrolling, so the existing candidates need affected-case validation before another workaround is chosen.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against ed1444b0de69.
Label changes
Label changes:
issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.issue-rating: 🦐 gold shrimp: Current issue advisory state no longer selects this label.clawsweeper:needs-info: Current issue advisory state no longer selects this label.Label justifications:
P0: Automatic restoration can repeatedly freeze the application and prevent in-product recovery, leaving ordinary users dependent on external tools or support.impact:crash-loop: Reported sustained native UI hangs persist across restarts while the Gateway remains healthy.impact:ux-release-blocker: The affected startup path can leave Settings unreachable; recovery currently requires intervention outside the application.Evidence reviewed
What I checked:
src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs:181, ed1444b0de69)src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj:106, ed1444b0de69)tests/OpenClaw.Tray.UITests/GatewayFixtureUiTests.cs:334, ed1444b0de69)src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs:269, ca8fb4a404ad)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 27, 2026, 12:26 PM ET / 16:26 UTC.
MilkyWay008 commentedon Aug 16, 2026
Saw the AppHangB1 when switching into a dense session, that is the client folding ~200 messages into one render on the UI thread, so it freezes no matter how healthy the gateway is. Until the batched projection lands, the practical stopgap is keeping those hot sessions lean (archive or clear older chats so the load stays under the render threshold, and avoid the really dense ones for now). I would grab a current-head Windows trace during the switch too, since it looks like no fix exists on main yet, that will pin the trigger fast. Oh also, btw, I built a portable Hermes OTG and I run it on USB as my rescue agent for exactly these client-froze-and-wont-recover moments, check it, imo it'll help you. https://github.com/MilkyWay008/Hermes-OTG
dotMorten commentedon Aug 18, 2026
@sebastian-openclaw I was trying to reproduce this issue and generated a bunch of long fake sessions.
It felt pretty snappy to me and is clearly using virtualization for rendering. Am I missing something in how I'm trying to reproduce it?
Recording.2026-08-18.093421.mp4
ShiroePL commentedon Sep 4, 2026
Additional live repro + process dump data
I can reproduce a hang that appears closely related to #1167, but my trigger is different: I do not manually switch sessions.
The Companion hangs during startup/reconnect when it automatically restores the large default/main session.
This is from the released Windows Companion build, not current
main, so I don't want to overstate it as the current-head trace requested above. However, I captured a full process dump while the UI was hung, and it narrows the hotspot considerably.Environment
2026.7.1-4c7c6fb06be036de512d824986a6eee6eca14abdb2026.7.2.02026.9.1OpenClaw.Tray.WinUI.exechat.historyresponse size: approximately 311 KBReproduction
My reproduction does not require manually switching sessions.
The Companion automatically restores the default/main session during startup or reconnect.
The reliable reproduction for me is:
chat.historyfor that session (~311 KB response).If the Gateway is unreachable when the Companion starts, the WinUI remains responsive.
Reconnecting to the Gateway triggers the session restoration/history-load path and can reproduce the hang.
The relevant log sequence is consistently:
[GatewayClient] Sending frame: chat.history
Wizard response payload kind=Object len=311126
Other reproductions were around
311072–311186bytes.After this point, gateway/node health and tick traffic continues while the native UI is frozen.
Windows records an Application Hang (Event ID 1002). The process is eventually terminated after remaining unresponsive.
Dump result
I captured a full dump with
dotnet-dumpwhileResponding=False.The process was consuming approximately one full CPU core during the hang, so this appears to be a CPU-bound UI-thread spin rather than a deadlock.
The main UI thread was captured in this path:
Program.Main
-> Application.Start
-> DispatcherQueueHandler.Do_Abi_Invoke
-> InitialTailPositioner.b__0()
-> InitialTailPositioner.StartTailRequest
-> ItemsView.StartBringItemIntoView(index, BringIntoViewOptions)
-> IItemsViewMethods.StartBringItemIntoView
The relevant OpenClaw code appears to be:
src/OpenClaw.Tray.WinUI/Chat/ReactorItemsViewScrollController.cs
Specifically,
OnLayoutUpdateddetaches the layout handler and enqueues a dispatcher callback, which then callsStartTailRequest. The dump catches the UI thread after that callback enters the native WinUIItemsView.StartBringItemIntoView()call.In this reproduction, history retrieval/parsing has already completed before the hang. The UI thread is captured inside the native
StartBringItemIntoView()call, and that call does not return for the duration of the observed hang.The apparent sequence is therefore:
large history restored
-> ItemsView populated
-> initial tail-follow / tail positioning
-> LayoutUpdated
-> dispatcher callback
-> InitialTailPositioner.StartTailRequest
-> ItemsView.StartBringItemIntoView(...)
-> native WinUI call does not return
-> UI thread consumes ~1 core
-> DispatcherQueue stops making progress
-> Application Hang
This suggests that, at least for this reproduction, the immediate hotspot is initial tail positioning /
StartBringItemIntoView()on the populated ItemsView, rather than JSON parsing or history projection itself.So I would consider this a refinement of #1167 rather than proof of the original suspected mechanism: the large-history restore still triggers the failure, but the captured hotspot is downstream in the initial tail-scroll path.
This also appears directly related to the initial-tail positioning concern previously tracked in #1054: the dump catches the UI thread inside the same
StartBringItemIntoViewpath discussed there.This seems distinct from the snapshot-coalescing work in #1301: the process dump catches the UI thread after snapshot/history application, inside the native tail-scroll path.
Dump availability
I retained the full dump locally, but I'm intentionally not attaching it because it is a full heap dump and may contain session/auth data.
I can provide additional redacted thread stacks / dump-derived diagnostics if useful.
If needed, I can also try to reproduce the same case against a current
main/nightly build to provide the current-head trace requested in the earlier review.33 remaining items
RomneyDa commentedon Oct 22, 2026
Additional triage: this remains a Companion reliability/startup-restoration bug, with no demonstrated security-boundary crossing in the evidence reviewed.
A further report on Store build 2026.10.401.0 describes a persistent native UI hang when automatically restoring a large main-session history, while Gateway health/tick traffic continues. Reducing that history reportedly restores startup responsiveness. This is a reporter observation, not an independent current-head reproduction; private correspondence and diagnostic material are not attached.
The existing public investigation remains the right owner:
InitialTailPositionerinChat/ReactorItemsViewScrollController.csis the application navigation owner. In inspected commit489208e06780c15920a9b3f35b1851534c0a3249, the layout handler detaches before queued navigation. Repeated hot stack samples alone do not distinguish one non-returning nativeStartBringItemIntoViewcall from repeated calls.Keeping #1167 open. No new patch, patched release, or passing runtime validation is claimed by this triage update.
RomneyDa commentedon Oct 22, 2026
Investigation update: no verified fix for the sustained native-chat hang yet.
The corrected synthetic startup fixtures restore all 465 mixed-height messages or all 77 tall-table messages. Earlier baseline/candidate startup runs passed on Reactor preview.12 and preview.16, including self-contained x64 Release under Windows ARM64 emulation. This is not native x64 or Store-package proof, and later instrumented runs also reproduced intermittent incorrect startup positioning.
A separate instrumented preview.16 run recorded 56 native
StartBringItemIntoViewentries and 56 returns, including four session replacements before the preceding native scroll completed. The app remained responsive during 48 rapid history selections. One startup case requested the final row but completed at offset zero, with focus still outside the transcript. This is a returned-but-mispositioned scroll, not the sustained UI-thread hang described here. It is consistent with, but does not independently prove, the compositor race described in microsoft/microsoft-ui-xaml#12086.The source detaches
LayoutUpdatedbefore issuing navigation; this evidence does not establish an endless successful app-side layout retry. The package upgrade and a tested extent-state adjustment did not reliably fix tail positioning. No scrolling workaround is being proposed from those results.For someone who can still reproduce the sustained hang: could you share the exact Companion version and CPU architecture, plus two redacted UI-thread stack samples taken a few seconds apart while it remains unresponsive? Please note whether background Gateway traffic continues. The important distinction is a single native navigation call that never returns versus repeated completed calls.
Please keep full process dumps, credentials, and conversation payloads out of this public issue. No conversation reset is needed or requested for this investigation.
roboclaw-bot commentedon Nov 10, 2026
Closing as a duplicate of #1568, not as fixed. The later dump evidence here narrows the sustained history-restoration hang to the same InitialTailPositioner.StartTailRequest -> ItemsView.StartBringItemIntoView UI-thread boundary documented there, with a healthy Gateway and matching released-build startup/reconnect reproductions. #1568 has the minimized tall-history reproducer and active #1935 (fix(chat): chat freezes when opening tall message history).
The independent dumps, valid tail index, original approximately 200-message switch scenario and later 886,583-byte startup restoration have been linked in #1568 for acceptance. This does not merge every native crash into that mechanism: the invalid-anchor crash and returned-but-mispositioned scroll observations remain explicitly distinguished. Please follow #1568 for the unresolved hang and current-build verification; no conversation reset or public full dump is requested.
Preserved evidence and acceptance cases: #1568 (comment)