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

Tray menu renders empty after extended uptime: icon failures are swallowed silently

Open matoulaile opened this issue 2 months ago • 3 comments

Summary

After roughly 90 minutes of continuous uptime, right-clicking the tray icon opens the menu window but it renders empty: no icons, no menu rows. The UI thread is still pumping (Responding=True), so this is not a hang.

Restarting the process restores it immediately.

Evidence: before/after restart

Metric Fresh process After ~90 min
Orphaned Microsoft.UI.Content.PopupWindowSiteBridge windows 0 3 (parked at -32000,-32000)
GDI objects 64 211 (+1.6/min)
USER objects 67 93
Working set 228 MB 416 MB

PopupWindowSiteBridge is the host window WinUI 3 creates for Popup/Flyout. These three survive after the tray menu closes and are never destroyed. Extrapolating the rate, GDI objects reach ~700 after about 7 hours.

Root cause

Icon construction failures are silently swallowed. src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml.cs:571:

var iconElement = ResolveIcon(icon);
if (iconElement != null)          // line 572
{
    ...
    Grid.SetColumn(iconElement, 0);
    grid.Children.Add(iconElement);
}

When null, nothing is added, nothing is thrown, nothing is logged. The row renders with an empty icon column.

Icons all funnel through src/OpenClaw.Tray.WinUI/Helpers/FluentIconCatalog.cs:118:

public static FontFamily SymbolThemeFontFamily =>
    (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];

59 call sites across the tray menu, chat, settings and nav all depend on this one property. It indexes the resource dictionary directly with no null check, no try/catch, and no fallback.

Supporting observation: OpenClaw.Tray.WinUI.pri contains the key name SymbolThemeFontFamily (next to BrandMark / TitleText / NavBackButton) but not the literal Segoe Fluent Icons. The font mapping is expected to be injected by the WinUI runtime during Application.Start, which is exactly where the native popup/GDI accumulation happens.

The same resource failure is visible in the log, repeating on every run:

[WARN] LocalizationHelper: Resource lookup failed for 'Chat_Composer_Slash_Loading' (language='<default>'): NamedResource not found

Suggested direction

  1. Add a fallback to SymbolThemeFontFamily: on lookup failure, fall back to new FontFamily("Segoe Fluent Icons"), or resolve to null and let Build return an icon without an explicit FontFamily so the default font fallback applies.
  2. Icon construction failure should not be silent. At minimum log one WARN on first failure so this is diagnosable.
  3. Track down the popup resource leak. PopupWindowSiteBridge windows are not destroyed when a Flyout closes, and WindowManager holds _chatWindow / _hubWindow / _trayMenuWindow as cached singletons with no invalidation strategy. Give them a resource-health check.

Impact

Long-running users see an empty menu with no error surfaced, which is very hard to self-diagnose. A restart clears it.

Required proof pools

  • UI (tray UX)

Validation

Report, not a code change. Window enumeration via EnumWindows plus GetGuiResources on the shipped 2026.9.4.0 binary, before and after restart.

matoulaile avatar Oct 01 '26 08:10 matoulaile

Codex review: this still needs some work.

Summary Keep open: an open PR explicitly targets this issue, and current main does not establish that the reported uptime failure is fixed.

Reproducibility: There is no high-confidence current-main reproduction: the report supplies shipped-build measurements, and the candidate test injects an invalid resource without reproducing uptime or showing the menu; no builds or tests ran during this read-only review, and WinApp was unavailable.

Root-cause cluster Relationship: canonical Canonical: https://github.com/openclaw/openclaw-windows-node/issues/1567 Summary: This issue owns the uptime rendering symptom, with one explicitly linked candidate repair whose coverage remains partial.

Members:

  • fixed_by_candidate: https://github.com/openclaw/openclaw-windows-node/pull/2123 - The open PR explicitly closes this issue and adds font fallback plus per-icon exception containment, without establishing resolution of popup accumulation.

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

Next step Evaluate https://github.com/openclaw/openclaw-windows-node/pull/2123 (fix: tray menu renders empty after extended uptime) with visible tray-menu fallback evidence and extended-uptime verification before treating this issue as resolved.

Review details

Best possible solution:

Restore reliable long-running tray rendering with diagnosable recovery while preserving intentional window reuse and Windows 10 icon compatibility.

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

There is no high-confidence current-main reproduction: the report supplies shipped-build measurements, and the candidate test injects an invalid resource without reproducing uptime or showing the menu; no builds or tests ran during this read-only review, and WinApp was unavailable.

Is this the best way to solve the issue?

Font fallback and per-icon containment are reasonable defensive changes, but the injected cast failure does not establish the uptime root cause, and replacing cached windows without allocation evidence could undo an earlier rendering repair.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • No captured font-resource failure connects the proposed cause to the natural long-uptime symptom.
  • Parked popup windows and resource growth have not been traced to a leaking allocation path.

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

Label changes

Label changes:

No label changes.

Label justifications:

  • P2: The reported uptime failure hides tray actions and recovers after restart, without establishing a first-run blocker or process outage in this issue.
  • impact:ux-friction: An empty tray menu removes visible actions and leaves users with a restart workaround.
Evidence reviewed

What I checked:

  • Open closing PR: https://github.com/openclaw/openclaw-windows-node/pull/2123 (fix: tray menu renders empty after extended uptime) remains open and explicitly declares that it closes this issue; its fallback and exception-containment changes have not merged. (aeca20bcdafe)
  • Current-main lookup remains unguarded: GitHub main matches the review checkout; SymbolThemeFontFamily directly casts the application resource, and Build assigns it to FontIcon without fallback. (src/OpenClaw.Tray.WinUI/Helpers/FluentIconCatalog.cs:141, a0a2a24ec1dd)
  • Construction exceptions already log: ShowMenu clears and rebuilds the menu before calling ShowAtCursor; construction exceptions reach LogCrash and Logger.Error, so the report's blanket silent-failure explanation is not supported. (src/OpenClaw.Tray.WinUI/Services/TrayController.cs:198, a0a2a24ec1dd)
  • Optional icons do not suppress labels: The cited row builder creates its label outside the optional-icon branch; ResolveIcon returns null for empty input and otherwise constructs icons without swallowing exceptions. (src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml.cs:588, a0a2a24ec1dd)
  • Candidate proof covers an injected condition: The PR test replaces SymbolThemeFontFamily with a string and inspects three constructed rows without displaying the menu; even0306 supplies a before/after harness link and reports no recurrence on a patched field build, but these do not establish the natural uptime trigger. (tests/OpenClaw.Tray.UITests/FluentIconFallbackProofTests.cs:38, aeca20bcdafe)
  • Window reuse has a correctness purpose: The historical submenu repair deliberately retained windows to avoid measurement failures before XamlRoot initialization; current source preserves that reuse and separately closes the cascade during shutdown. (src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml.cs:1233, 2ca192d0dabc)
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 16, 2026, 10:55 PM ET / November 17, 2026, 03:55 UTC.

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

This issue has been automatically marked as stale due to inactivity. Please add updated OpenClaw Windows details or it will be closed.

github-actions[bot] avatar Oct 16 '26 03:10 github-actions[bot]

This issue has been automatically marked as stale due to inactivity. Please add updated OpenClaw Windows details or it will be closed.

github-actions[bot] avatar Nov 16 '26 03:11 github-actions[bot]