From ab531b262018af9d0b2d17085a63267a7147fea5 Mon Sep 17 00:00:00 2001 From: Shawn Yuan <128874481+shuaiyuanxx@users.noreply.github.com> Date: Thu, 25 Dec 2025 11:57:51 +0800 Subject: [PATCH] Fix empty endpoint issue (#44415) ## Summary of the Pull Request This pull request introduces a small but important improvement to the handling of AI provider endpoint configuration in the advanced paste settings. Now, if an endpoint is required but not provided by the user, a placeholder value will be set automatically. ## PR Checklist - [ ] Closes: #xxx - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- .../Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs index 130230e2d9..8cae5dbd5f 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs @@ -794,6 +794,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views { endpoint = string.Empty; } + else if (string.IsNullOrEmpty(endpoint)) + { + // If endpoint is required but not provided, use placeholder. + endpoint = GetEndpointPlaceholder(serviceKind); + } // For endpoint-based services, keep empty if the user didn't provide a value. if (RequiresApiKeyForService(serviceType) && string.IsNullOrWhiteSpace(trimmedApiKey))