Skip to content

OpenClaw Companion (Windows) crashes within 6-90s of startup - WinUI 3 ArrangeOverride throws E_INVALIDARG #1410

Description

@taardissss

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 module Microsoft.UI.Xaml.dll.
  • App crash.log: System.ArgumentException: 参数错误。 with the stack pinned to IFrameworkElementOverrides.ArrangeOverride (see below).
  • App log shows the crash happens ~137ms after the gateway handshake completes and the chat.history wizard 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:19999 dead).

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:

  1. Crash timing strictly matches the wizard response rendering (137ms window).
  2. With the gateway disconnected the app still crashes — the main chat view requests and renders that data regardless, so disconnecting cannot bypass it.
  3. "UseLegacyWebChat": true switches 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.
  4. Scale 150%, third-party injections, and system component state were all ruled out one by one (Oray disabled, Nahimic stopped, sfc /scannow clean, 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

  1. Windows 11 24H2 + Companion 2026.9.3 + Gateway 2026.9.4 (node26).
  2. 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.history wizard 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 UseLegacyWebChat for 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions