CmdPal: Replace SupersedingAsyncGate with a coalescing runner #51381

Open
jiripolasek opened 6:35pm on October 17, 2026 wants to merge 5 commits into microsoft/powertoys main from
dev/jpolasek/f/51369-cmdpal-coalescing-runner
jiripolasek authored
of work during October 17
Diff Delta:
0
About 0 Diff Delta/hour
Classified as:  Feature Add, General

zadjii-msft's Description of Work

Summary of the Pull Request

SupersedingAsyncGate handles command reloads, provider-cache saves and bookmark saves. These callers need one run at a time, with requests received during a run grouped into a follow-up run. They do not need the gate to cancel or supersede active work.

CoalescingAsyncRunner provides that simpler contract directly: one active batch and at most one pending batch, with each request completing with its batch's outcome. This removes cancellation and supersession bookkeeping while keeping pending requests reliable.


  • Preserves pending requests and propagates each batch's outcome to its callers.

  • Keeps loading state accurate across startup, reloads and provider activities, with reload completion notifications when the reload queue drains.

  • Bounds provider-enable waits and publishes late results only while their load is still current.

  • Lets bookmark and provider-cache owners drain accepted saves through asynchronous disposal.

PR Checklist


  • [x] Closes: #51369
    <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) -->

  • [ ] Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected

  • [ ] 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



  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

20 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
You’ve completed the full review pass
Like the credits, but with fewer stunts.