openclaw / openclaw/openclaw-windows-node
OpenClaw Companion (Windows) crashes within 6-90s of startup - WinUI 3 ArrangeOverride throws E_INVALIDARG
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 295
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 99
Description
Summary
Companion (v2026.9.3, Windows 11 24H2) reliably crashes 6–90 seconds after startup, every launch. The crash happens while the native XAML chat view is rendering the gateway-pushed wizard/startup data. It is an app-side WinUI 3 layout bug, not an environment problem. Setting "UseLegacyWebChat": true in %APPDATA%\OpenClawTray\settings.json (chat falls back to the legacy Web rendering path) fully avoids the crash — verified stable for 180s+ across multiple restarts.
Environment
| Item | Value |
|---|---|
| OS | Windows 11 Home CN 24H2, Build 10.0.26100 (UBR .768) |
| Hardware | Lenovo Legion laptop, NVIDIA RTX 4050 (driver 32.0.15.8088) |
| Display | Single monitor 2560×1600, system scale 150% (AppliedDPI=144) |
| OpenClaw Companion | 2026.9.3.0 (official installer, %LOCALAPPDATA%\OpenClawTray) |
| Gateway / CLI | 2026.9.4 (node26 runtime) |
| WinUI runtime | Bundled Microsoft.UI.Xaml.dll 3.2.3.2608; system WindowsAppRuntime 1.1–2.x registered fine |
| Third-party injection | Nahimic audio (AudioDevProps2.dll), Oray virtual display driver — both ruled out |
Symptoms
- App exits 6–90s after launch, every time; window may flash and disappear.
- Windows Event Log (Application Error): exception code
0xc000027b(STATUS_STOWED_EXCEPTION), faulting moduleMicrosoft.UI.Xaml.dll. - App
crash.log:System.ArgumentException: 参数错误。with the stack pinned toIFrameworkElementOverrides.ArrangeOverride(see below). - App log shows the crash happens ~137ms after the gateway handshake completes and the
chat.historywizard response (~84KB,kind=Object) arrives — i.e., exactly while the main chat view is rendering. - Unrelated to gateway connectivity: crashing also occurs with the gateway unreachable (
ws://127.0.0.1:19999dead).
Crash stack (crash.log)
System.ArgumentException: 参数错误。
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.ArrangeOverride(IObjectReference _obj, Size finalSize)
at Microsoft.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
App log (137ms before crash):
[13:49:05.126] [GatewayClient] Sending frame: chat.history
[13:49:05.144] Wizard response payload kind=Object len=84585
[13:49:05.283] [ERROR] CRASH UnhandledException: System.ArgumentException: 参数错误。
Root cause analysis
The crash originates in the native layout implementation of Microsoft.UI.Xaml.dll: the managed layer calls IFrameworkElementOverrides.ArrangeOverride, and the native side returns E_INVALIDARG (0x80070057). In WinUI 3 this is typical when a chat message / wizard payload with a specific structure (nested cards, Markdown, tool-call blocks) produces an invalid size during measure/arrange.
Evidence chain:
- Crash timing strictly matches the wizard response rendering (137ms window).
- With the gateway disconnected the app still crashes — the main chat view requests and renders that data regardless, so disconnecting cannot bypass it.
"UseLegacyWebChat": trueswitches the chat to the WebView path, which never touches the native XAML chat controls — crashes stop. This inversely confirms the native chat view layout path as the culprit.- Scale 150%, third-party injections, and system component state were all ruled out one by one (Oray disabled, Nahimic stopped,
sfc /scannowclean, DPI compat flags, reinstall,NodeCanvasEnabled/NodeScreenEnabled=false).
Workaround (verified)
Edit %APPDATA%\OpenClawTray\settings.json:
{
"UseLegacyWebChat": true,
"AppTheme": "Light"
}
Result: 0 crashes across multiple restarts, 180s+ continuous uptime, all features (chat/settings/notifications/hotkeys) functional. AppTheme: Dark also crashes in the same environment, so the theme change alone is not sufficient — the key switch is UseLegacyWebChat.
Reproduction steps
- Windows 11 24H2 + Companion 2026.9.3 + Gateway 2026.9.4 (node26).
- Complete pairing, then start Companion and wait for the main chat view to load the wizard startup data. Reproduces consistently at 150% display scale (appears deterministic).
Suggested fix direction
- Review the rendering path of
sessions.messages/chat.historywizard payloads (kind=Object, ~84KB) in the native chat message-list control; focus on layout measurement of wizard card structures (nested cards / Markdown / tool-call blocks). - Regression-check the Dark theme path (
AppTheme=Dark), which crashes in the same environment. - Consider auto-falling back to
UseLegacyWebChatfor affected users, or routing wizard startup data to a Web-chat-only channel.
Additional material
A full 7-page troubleshooting report (Chinese) with all logs, timeline and verification data is available on request — happy to share it here if maintainers want the complete evidence.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce on Windows 11 24H2 with Companion 2026.9.3, 150% scale, and the native chat path enabled, then trace rendering after the chat.history wizard response arrives. Focus on the native chat message-list layout for nested cards, Markdown, and tool-call blocks, including the Dark theme path. Done means the startup data renders without the ArrangeOverride E_INVALIDARG crash, while UseLegacyWebChat remains a verified workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100