From 9fc64e66da48d3ce706fe4a2a3eb02c8ef65f907 Mon Sep 17 00:00:00 2001 From: QQ Date: Sun, 31 May 2026 19:42:24 +0800 Subject: [PATCH 1/2] Fix chat session routing from Sessions page and toast notifications Previously, clicking a session in the Sessions tab or a chat toast notification always opened the default/main session instead of the specific session. Changes: - Add App.PendingChatSessionKey as a fallback when HubWindow does not exist (background notifications, closed HubWindow). - Thread sessionKey through ToastActivationRouter (Action). - Embed sessionKey in chat toast arguments and route it on activation. - ChatPage (functional): consume pending key from both HubWindow and App fallbacks; use !string.IsNullOrEmpty guard to treat empty string as null. - ChatPage (WebView): consume pending key and append &session={key} to the navigation URL, or pass it through GatewayChatHelper on initial WebView init. - SessionsPage: write key to CurrentApp.PendingChatSessionKey in addition to hub.PendingChatSessionKey. - Update tests for the new OpenChat Action contract. Fixes session routing for both native FunctionalUI and legacy WebView2 chat surfaces. --- src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs b/src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs index 15a04fba9..85f248655 100644 --- a/src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs +++ b/src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs @@ -423,7 +423,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings) return; } - if (!GatewayChatHelper.TryBuildChatUrl(credential.GatewayUrl, credential.Token, out var chatUrl, out var errorMessage)) + if (!GatewayChatHelper.TryBuildChatUrl(credential.GatewayUrl, credential.Token, out var chatUrl, out var errorMessage, _pendingWebViewSessionKey)) { PlaceholderPanel.Visibility = Visibility.Collapsed; ErrorPanel.Visibility = Visibility.Visible; @@ -432,6 +432,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings) } _chatUrl = chatUrl; _chatUrl = chatUrl; + _pendingWebViewSessionKey = null; PlaceholderPanel.Visibility = Visibility.Collapsed; ErrorPanel.Visibility = Visibility.Collapsed; From 6223da07b84a57ba42f23871412e47f42969d121 Mon Sep 17 00:00:00 2001 From: QQSHI13 Date: Wed, 24 Jun 2026 20:43:06 +0800 Subject: [PATCH 2/2] fix(mxc): align build and UBR checks with mxc-sdk platform detection The MxcAvailability probe used stale build constants (26300 / UBR 8289) instead of matching the @microsoft/mxc-sdk getPlatformSupport() values (build >= 26100, UBR >= 7965 for builds 26100-26500, no UBR minimum for builds >= 26500). This caused false-negative sandbox unavailability on newer Windows builds that the SDK considers supported. Changes: - Replace exact-equality build check with minimum-build (>= 26100) check - Align UBR minimum from 8289 to 7965 - Relax UBR requirement for builds >= 26500 (SDK policy) - Update tests to cover the expanded build range --- src/OpenClaw.Shared/Mxc/MxcAvailability.cs | 25 ++++++++-------- .../Mxc/MxcAvailabilityTests.cs | 29 +++++++++++++------ 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/OpenClaw.Shared/Mxc/MxcAvailability.cs b/src/OpenClaw.Shared/Mxc/MxcAvailability.cs index bffe5a114..a4fbfe5e7 100644 --- a/src/OpenClaw.Shared/Mxc/MxcAvailability.cs +++ b/src/OpenClaw.Shared/Mxc/MxcAvailability.cs @@ -8,7 +8,7 @@ namespace OpenClaw.Shared.Mxc; /// /// Backends checked: /// -/// — Windows 11 build 26300 with UBR >= 8289, x64 / arm64. +/// — Windows build >= 26100 with UBR >= 7965 (builds 26100–26500), x64 / arm64. /// — wxc-exec.exe found in the shipped tray output layout or via override. /// — requires AppContainer plus IsolationProxy.exe in System32. /// @@ -22,14 +22,13 @@ public sealed class MxcAvailability /// public const string WxcExecOverrideEnvVar = "OPENCLAW_WXC_EXEC"; - private const int SupportedBuild = 26300; - - // TODO: This is all temporary and a moment in time; feature gate this correctly ASAP. - /// - /// Temporary MXC support table: only build 26300 with UBR 8289+ is enabled. - /// All other builds are blocked until validated and the table is updated. - /// - private const int MinSupportedUbr = 8289; + // Matches @microsoft/mxc-sdk platform.checkWindowsBuildVersion(): + // - Build >= 26100 required. + // - Builds 26100–26500 require UBR >= 7965. + // - Builds >= 26500 have no UBR minimum. + private const int MinBuild = 26100; + private const int MinSupportedUbr = 7965; + private const int UbrRelaxedBuild = 26500; public bool IsAppContainerAvailable { get; } public bool IsIsolationSessionAvailable { get; } @@ -114,14 +113,14 @@ public static MxcAvailability Probe(IOpenClawLogger? logger = null) internal static string? GetWindowsBuildUnsupportedReason(int build, int ubr) { - if (build != SupportedBuild) - return $"Windows build {build} is not MXC supported build {SupportedBuild}."; + if (build < MinBuild) + return $"Windows build {build} is below MXC minimum {MinBuild}."; - if (ubr < MinSupportedUbr) + if (build < UbrRelaxedBuild && ubr < MinSupportedUbr) { return $"Windows UBR {ubr} below MXC minimum {MinSupportedUbr} " + - $"(for build {SupportedBuild}). " + + $"(for build {build}). " + "Install latest cumulative update."; } diff --git a/tests/OpenClaw.Shared.Tests/Mxc/MxcAvailabilityTests.cs b/tests/OpenClaw.Shared.Tests/Mxc/MxcAvailabilityTests.cs index f8e1a9994..3679e492c 100644 --- a/tests/OpenClaw.Shared.Tests/Mxc/MxcAvailabilityTests.cs +++ b/tests/OpenClaw.Shared.Tests/Mxc/MxcAvailabilityTests.cs @@ -65,25 +65,36 @@ public void Constructor_StoresAllFields() } [Theory] - [InlineData(26299, 9999, "is not MXC supported build 26300")] - [InlineData(26300, 8288, "Windows UBR 8288 below MXC minimum 8289")] - [InlineData(26301, 9999, "is not MXC supported build 26300")] - [InlineData(27999, 9999, "is not MXC supported build 26300")] - [InlineData(28000, 9999, "is not MXC supported build 26300")] + [InlineData(26099, 9999, "is below MXC minimum 26100")] + [InlineData(26100, 7964, "Windows UBR 7964 below MXC minimum 7965")] + [InlineData(26300, 7964, "Windows UBR 7964 below MXC minimum 7965")] + [InlineData(26499, 7964, "Windows UBR 7964 below MXC minimum 7965")] + [InlineData(26500, 1, null)] + [InlineData(27000, 0, null)] public void GetWindowsBuildUnsupportedReason_RejectsUnsupportedBuilds( int build, int ubr, - string expectedReason) + string? expectedReason) { var reason = MxcAvailability.GetWindowsBuildUnsupportedReason(build, ubr); - Assert.NotNull(reason); - Assert.Contains(expectedReason, reason); + if (expectedReason is null) + { + Assert.Null(reason); + } + else + { + Assert.NotNull(reason); + Assert.Contains(expectedReason, reason); + } } [Theory] + [InlineData(26100, 7965)] + [InlineData(26100, 9999)] [InlineData(26300, 8289)] - [InlineData(26300, 9999)] + [InlineData(26500, 0)] + [InlineData(27000, 0)] public void GetWindowsBuildUnsupportedReason_AllowsSupportedBuilds(int build, int ubr) { var reason = MxcAvailability.GetWindowsBuildUnsupportedReason(build, ubr);