Repository navigation
Commit 482dd30
OpenClaw Agent (on behalf of BennyAI2)
fix(chat): coalesce Publish() bursts to prevent WinUI3 layout-cycle crash
Rapid Publish() calls during fast tool-activity bursts each independently
scheduled a Changed?.Invoke dispatch via _post(). When events arrived
faster than the WinUI3 dispatcher could drain them, the Reactor visual
tree was mutated multiple times before a layout pass settled, which
crashed the tray process with Microsoft.UI.Xaml.LayoutCycleException
("Layout cycle detected" / "Element is already the child of another
element").
Coalesce bursts so only the latest snapshot per drain cycle is published,
using a small lock-guarded pending-snapshot flag. This matches the existing
UI-thread marshaling contract (Action<Action> _post) and does not change
observable behavior when updates are not bursty.
Reproduced twice on a live install (2026-08-30 and 2026-09-01) via
crash.log + Windows Event Log correlation with openclaw-tray.log; both
crashes occurred within ~150ms of a fast tool-call event burst followed
by a sessions.changed-triggered refresh.1 parent f46400a commit 482dd30
1 file changed
Lines changed: 43 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
1809 | 1812 | | |
1810 | 1813 | | |
1811 | 1814 | | |
1812 | | - | |
1813 | 1815 | | |
1814 | 1816 | | |
1815 | | - | |
| 1817 | + | |
1816 | 1818 | | |
1817 | 1819 | | |
1818 | 1820 | | |
1819 | | - | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
1820 | 1860 | | |
1821 | 1861 | | |
1822 | 1862 | | |
| |||
0 commit comments