From 797da0bce84c659d4afba773113d92ebb1ddcb5c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 31 Mar 2026 12:59:18 +0000 Subject: [PATCH] fix: respect PlaySound flag in system.notify node notifications When an agent invokes system.notify with sound=false, the PlaySound field in SystemNotifyArgs was correctly populated by SystemCapability but then silently ignored in OnNodeNotificationRequested. The toast was always shown with sound regardless of the per-notification flag. Fix: check args.PlaySound before showing the toast and add a silent audio element when the agent has explicitly requested no sound. This is orthogonal to the user-level NotificationSound preference (addressed in PR #95): PlaySound=false suppresses sound for that specific notification only, regardless of the global sound setting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/OpenClaw.Tray.WinUI/App.xaml.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/OpenClaw.Tray.WinUI/App.xaml.cs b/src/OpenClaw.Tray.WinUI/App.xaml.cs index de0780f..5db5039 100644 --- a/src/OpenClaw.Tray.WinUI/App.xaml.cs +++ b/src/OpenClaw.Tray.WinUI/App.xaml.cs @@ -1200,10 +1200,15 @@ private void OnNodeNotificationRequested(object? sender, OpenClaw.Shared.Capabil // Agent requested a notification via node.invoke system.notify try { - new ToastContentBuilder() + var builder = new ToastContentBuilder() .AddText(args.Title) - .AddText(args.Body) - .Show(); + .AddText(args.Body); + + // Respect the per-notification sound flag from the agent (system.notify sound=false) + if (!args.PlaySound) + builder.AddAudio(silent: true); + + builder.Show(); } catch (Exception ex) {