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

Pull Request Overview

  • Opened on October 17, 2026
  • Status Open
  • Commit count 5 with first commit October 17, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 17 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Data pending calculation for pull request

Author avatar

CmdPal: Replace SupersedingAsyncGate with a coalescing runner

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

No comments have been left on this PR.