Skip to content

[review-mirror] Advanced Paste additional customizations and PhiSilica provider - #4

Open
yeelam-gordon wants to merge 109 commits into
mainfrom
prreview/46727/gleb/advanced-paste
Open

[review-mirror] Advanced Paste additional customizations and PhiSilica provider#4
yeelam-gordon wants to merge 109 commits into
mainfrom
prreview/46727/gleb/advanced-paste

Conversation

@yeelam-gordon

Copy link
Copy Markdown
Owner

Review sandbox mirror of microsoft#46727 (branch gleb/advanced-paste).

Opened by PR-autopilot to run Copilot Code Review + local build validation in the fork. Not for merge.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Advanced Paste capabilities across Settings UI + module runtime: per-action provider selection, a new “Fix spelling and grammar” action with an optional coaching hotkey/preview, and a Phi Silica (on-device) AI provider with sparse-package based availability/provisioning flow. Also updates packaging/build/pipelines/installer and dev docs to support Phi Silica’s limited-access + WinRT metadata requirements.

Changes:

  • Adds Phi Silica provider support end-to-end (service type registry + Settings UI probe/prepare UX + module provider implementation).
  • Adds additional action customizations (Fix Spelling & Grammar prompts/system prompts, coaching mode + coaching hotkey, per-action provider selection).
  • Updates packaging/installer/pipelines to include required WinRT metadata and support sparse identity/dev registration.

Reviewed changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/settings-ui/Settings.UI/ViewModels/AdvancedPasteViewModel.cs Syncs provider “active” UI flags; adds default-provider action; updates hotkey/conflict tracking for coaching hotkey
src/settings-ui/Settings.UI/Strings/en-us/Resources.resw Adds Settings UI strings for new action customization, provider UX, and Phi Silica states
src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs Adds Phi Silica availability probing + prepare flow via AdvancedPaste subprocess; adds provider defaulting and UI helpers
src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml Adds UI for default provider badge/menu item; adds Fix Spelling & Grammar expander with coaching + provider selectors
src/settings-ui/Settings.UI.Library/AIServiceTypeRegistry.cs Registers Phi Silica metadata (display name/icon/legal label)
src/settings-ui/Settings.UI.Library/AIServiceTypeExtensions.cs Adds Phi Silica string mappings/normalization
src/settings-ui/Settings.UI.Library/AIServiceType.cs Adds PhiSilica enum member
src/settings-ui/Settings.UI.Library/AdvancedPasteSettings.cs Aligns hotkey accessor order with runner; adds Fix Spelling & Grammar and coaching hotkey accessor
src/settings-ui/Settings.UI.Library/AdvancedPasteDefaultPrompts.cs Introduces shared default prompts for built-in AI actions
src/settings-ui/Settings.UI.Library/AdvancedPasteCustomAction.cs Adds per-custom-action provider selection persistence (provider-id)
src/settings-ui/Settings.UI.Library/AdvancedPasteAdditionalActions.cs Adds Fix Spelling & Grammar additional action to settings schema
src/settings-ui/Settings.UI.Library/AdvancedPasteAdditionalAction.cs Adds prompts/system prompts, provider ids, and coaching settings/shortcut to additional actions schema
src/PhiSilicaLaf.props Adds MSBuild properties for Phi Silica LAF token/attestation
src/PackageIdentity/BuildSparsePackage.ps1 Adds unregister/dev-register helpers for sparse package dev workflows and cert trust setup
src/PackageIdentity/AppxManifest.xml Adds sparse-package application entry for PowerToys.AdvancedPaste.exe
src/modules/AdvancedPaste/custom.props Adds XES versioning properties for Advanced Paste
src/modules/AdvancedPaste/AdvancedPasteModuleInterface/dllmain.cpp Registers coaching hotkey; adds Fix Spelling action ordering; applies auto-copy-selection to all hotkeys
src/modules/AdvancedPaste/AdvancedPasteModuleInterface/AdvancedPasteProcessManager.cpp Adjusts process launch path and increases pipe client connection timeout
src/modules/AdvancedPaste/AdvancedPasteModuleInterface/AdvancedPasteModuleInterface.vcxproj Minor formatting change
src/modules/AdvancedPaste/AdvancedPasteModuleInterface/AdvancedPaste.base.rc Removes embedded VERSIONINFO resource block
src/modules/AdvancedPaste/AdvancedPaste/ViewModels/OptionsViewModel.cs Adds per-format provider id routing; adds coaching explanation generation + preview forcing
src/modules/AdvancedPaste/AdvancedPaste/Strings/en-us/Resources.resw Adds strings for Fix Spelling and coaching explanation title
src/modules/AdvancedPaste/AdvancedPaste/Services/PasteFormatExecutor.cs Adds Fix Spelling execution path; passes provider override into AI transforms
src/modules/AdvancedPaste/AdvancedPaste/Services/KernelServiceBase.cs Adds optional providerIdOverride parameter
src/modules/AdvancedPaste/AdvancedPaste/Services/IKernelService.cs Adds optional providerIdOverride parameter
src/modules/AdvancedPaste/AdvancedPaste/Services/IAICredentialsProvider.cs Adds per-provider credential lookup API
src/modules/AdvancedPaste/AdvancedPaste/Services/EnhancedVaultCredentialsProvider.cs Implements per-provider key lookup; ensures password is retrieved from vault
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/SemanticKernelPasteProvider.cs Tweaks OpenAI/Azure OpenAI execution settings (reasoning effort)
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/PhiSilicaPasteProvider.cs Adds Phi Silica provider implementation using Windows AI LanguageModel APIs
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/PasteAIProviderFactory.cs Registers Phi Silica provider
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/ICustomActionTransformService.cs Adds system prompt + provider override parameters
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/CustomActionTransformService.cs Adds provider selection routing and system prompt override
src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActionKernelQueryCacheService.cs Injects localization delegate for testability
src/modules/AdvancedPaste/AdvancedPaste/Program.cs Adds --check-phi-silica / --prepare-phi-silica non-UI entrypoints; returns exit codes
src/modules/AdvancedPaste/AdvancedPaste/PhiSilicaLafHelper.cs Adds LAF unlock helper with diagnostics caching semantics
src/modules/AdvancedPaste/AdvancedPaste/Models/PasteFormats.cs Adds FixSpellingAndGrammar format metadata
src/modules/AdvancedPaste/AdvancedPaste/Models/PasteFormat.cs Adds per-format ProviderId support
src/modules/AdvancedPaste/AdvancedPaste/Helpers/UserSettings.cs Plumbs Fix Spelling & coaching settings from settings schema into runtime settings
src/modules/AdvancedPaste/AdvancedPaste/Helpers/NativeMethods.cs Removes unused System.Windows.Point conversion operator
src/modules/AdvancedPaste/AdvancedPaste/Helpers/IUserSettings.cs Adds Fix Spelling & coaching settings surface to runtime
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPasteXAML/Controls/PromptBox.xaml Adds coaching explanation UI panel in preview
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPasteXAML/App.xaml.cs Adds coaching IPC key parsing (-coaching) and forces coaching execution path
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPaste.prod.manifest Adds prod app manifest for sparse identity metadata
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPaste.dev.manifest Adds dev app manifest for sparse identity metadata
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPaste.csproj Adds AI package ref; introduces dev/prod manifests; generates Phi Silica LAF credential source; versioning adjustments
src/modules/AdvancedPaste/AdvancedPaste.UnitTests/ServicesTests/CustomActionKernelQueryCacheServiceTests.cs Updates tests to inject localizer delegate
src/modules/AdvancedPaste/AdvancedPaste.UnitTests/Mocks/IntegrationTestUserSettings.cs Updates mock settings for new Fix Spelling/coaching properties
installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Includes *.winmd in installer harvest and excludes CmdPal winmd to avoid WiX conflicts
doc/devdocs/modules/advancedpaste.md Documents debugging and sparse package identity setup for Phi Silica
doc/devdocs/modules/advancedpaste-phisilica-local-testing.md Adds detailed Phi Silica local testing/troubleshooting guide
Directory.Build.props Imports Phi Silica LAF MSBuild properties globally
.pipelines/v2/templates/job-build-project.yml Ensures versioning setup order accounts for Advanced Paste custom.props vs CmdPal
.pipelines/v2/release.yml Passes Phi Silica LAF secrets via MSBuild properties in release pipeline
.github/actions/spell-check/patterns.txt Allows Phi Silica token/ID patterns for spell-check
.github/actions/spell-check/allow/code.txt Adds Phi Silica/LAF related terms to allowlist

Comment thread src/PhiSilicaLaf.props
Comment on lines +4 to +8
<!-- Phi Silica Limited Access Feature credentials.
Local dev defaults below; overridden by /p: in release pipelines. -->
<PhiSilicaLafToken Condition="'$(PhiSilicaLafToken)'==''">RmToMMYJHZkQSrKP5lWesA==</PhiSilicaLafToken>
<PhiSilicaLafAttestation Condition="'$(PhiSilicaLafAttestation)'==''">djwsxzxb4ksa8</PhiSilicaLafAttestation>
</PropertyGroup>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escalating for human review: these are LAF dev credentials/attestation values intentionally documented as local-dev defaults, while prod is injected by CI. Moving or removing them changes the Phi Silica dev/prod credential flow, so this should be decided by the feature owners rather than auto-fixed in the sandbox mirror.

Comment thread src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs Outdated
Comment thread src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml.cs Outdated
@github-actions

This comment has been minimized.

Preserve custom action provider selections through direct and Advanced AI action paths, fix bool-to-Visibility XAML bindings, and observe redirected child process tasks on timeout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yeelam-gordon

Copy link
Copy Markdown
Owner Author

PR review owner verdict — NEEDS_HUMAN_REVIEW

Build/test: PASS

  • AdvancedPaste.csproj Release|x64: passed
  • PowerToys.Settings.csproj Release|x64: passed
  • AdvancedPaste.UnitTests.csproj Release|x64: passed
  • vstest.console.exe AdvancedPaste.UnitTests.dll: passed (28 passed, 14 skipped)

Fixes pushed: d5173b06dc

  • Preserved saved provider IDs for custom actions through direct execution and Advanced AI tool/action chains, preventing local-provider actions from falling back to an active cloud provider.
  • Fixed four compiled XAML boolVisibility bindings with BoolToVisibilityConverter.
  • Observed redirected stdout/stderr tasks after Phi Silica probe/prepare timeout cleanup.

Open human escalations / findings:

  1. src/PhiSilicaLaf.props contains dev LAF token/attestation defaults baked into binaries; left open for feature-owner security/design decision.
  2. PhiSilica/local-provider GPO behavior appears inconsistent: local providers can still be blocked by global online-AI gating, and PhiSilica has no explicit per-provider GPO rule.
  3. New Microsoft.WindowsAppSDK.AI dependency should get NOTICE/license review before merge.
  4. AdvancedPaste.csproj uses $(AdvancedPasteVersion) but no definition was found; verify intended product versioning.

Copilot convergence: not fully converged. All fix/decline-owned threads were replied/resolved; 1 escalation remains open. Copilot has not posted a review on new HEAD d5173b06dc after the push wait.

Manual validation checklist:

  • On unsupported/non-Copilot+ hardware, add Phi Silica provider: UI should show unavailable/not supported and not enable Save.
  • On supported hardware with model absent, use Prepare/Download: UI should stay responsive, show status/diagnostics, and enable Save only when Ready.
  • Configure a PhiSilica provider for a saved custom action while a cloud provider is active; run the custom action and confirm clipboard content stays local.
  • Run Fix spelling + coaching with provider overrides; confirm selected providers are honored.
  • Disable online-AI and local-provider policies (where available) and verify Settings UI/runtime behavior matches policy intent.

@github-actions

Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (85)
accepteula
autorun
BEARNING
CABAC
choosecharacter
CLASSNOTREGISTERED
clipboardhistor
cmb
commicrosoftcmd
dedup
endgroup
endtask
exps
extensiononly
filenameonly
flippable
foregrounding
Freelook
Godot
gotcha
greenfield
hesiate
hideleadingdigi
hidethefileexte
Hmmss
HTBOTTOM
HTBOTTOMLEFT
HTLEFT
HTMLPEEKMARKER
HTNOWHERE
HTRIGHT
HTTOP
HTTOPLEFT
HTTOPRIGHT
idempotently
ILC
inh
initialises
interactable
itm
keepme
launchgame
letterboxed
letterboxing
logissue
Mdd
Miracast
Mnu
MODULEUI
msgamelaunch
NETSDK
nojekyll
nonelevated
olk
oneline
ouside
pasteas
pasteasjson
pasteasmarkdown
pasteasplaintex
PJT
psexec
ptbk
PTLONGPATH
quser
qwinsta
racey
REGDB
relogin
respawns
rewordings
rgt
screenshotting
sendinput
SETFOREGROUNDLOCKTIMEOUT
sideload
sideloading
tfm
Tgl
timestamped
uncomposited
unsubscribes
VKs
watsonportal
zzz
These words are not needed and should be removed ATRIOX Autorun Dedup Gotchas intput MTND NONELEVATED NOTXORPEN nullability pfo ssf TILLSON Unsubscribes Uptool VISEGRADRELAY WKSG

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:yeelam-gordon/PowerToys.git repository
on the prreview/46727/gleb/advanced-paste branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/yeelam-gordon/PowerToys/actions/runs/29162237463/attempts/1' &&
git commit -m 'Update check-spelling metadata'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
@check-spelling-bot apply updates.

Forbidden patterns 🙅 (7)

In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves.

These forbidden patterns matched content:

Articles generally shouldn't be used without a noun and a verb
  • Perhaps you're missing a verb between the noun and the second article.
  • Or, perhaps you should remove the first verb and treat the intervening word as a verb?
  • In some cases you should add a , between the noun and the second article.
\s(?:an?|the(?! action))\s(?!way|wh|(?:how|priori)\b)[A-Za-z][a-z]+[a-qs-z]\s(?:a(?! (?:bit|few|little|lot|posteriori))n?|the(?! same))\s
Should be ; otherwise or . Otherwise

https://study.com/learn/lesson/otherwise-in-a-sentence.html

, [Oo]therwise\b
Should be preexisting
[Pp]re[- ]existing
Should be nonexistent
\b[Nn]o[nt][- ]existent\b
Should be into

when not phrasal and when in order to would be wrong:
https://thewritepractice.com/into-vs-in-to/

(?<!opt)\sin to\s(?!if\b)
Should be prepopulate
[Pp]re[- ]populate
In English, duplicated words are generally mistakes

There are a few exceptions (e.g. "that that").
If the highlighted doubled word pair is in:

  • code, write a pattern to mask it.
  • prose, have someone read the English before you dismiss this error.
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s

Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spell-check/patterns.txt:

# Automatically suggested patterns

# hit-count: 7 file-count: 3
# Non-English
# Even repositories expecting pure English content can unintentionally have Non-English content... People will occasionally mistakenly enter [homoglyphs](https://en.wikipedia.org/wiki/Homoglyph) which are essentially typos, and using this pattern will mean check-spelling will not complain about them.
# .
# If the content to be checked should be written in English and the only Non-English items will be people's names, then you can consider adding this.
# .
# Alternatively, if you're using check-spelling v0.0.25+, and you would like to _check_ the Non-English content for spelling errors, you can. For information on how to do so, see:
# https://docs.check-spelling.dev/Feature:-Configurable-word-characters.html#unicode
[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,}

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Errors and Notices ❌ (3)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

❌ Errors and Notices Count
ℹ️ candidate-pattern 3
❌ check-file-path 4
❌ forbidden-pattern 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants