This pull request's diff hasn't been prepared yet. Log in with GitHub to have us prepare it for review.

CmdPal: Safely handle invoking an extension that died #51443

Closed
zadjii-msft opened 9:26pm on October 20, 2026 wanted to merge 375 Ξ” into microsoft/powertoys main from
dev/migrie/b/dock-item-crash-2

Pull Request Overview

  • Opened on October 20, 2026
  • Status Closed
  • Commit count 7 with first commit October 20, 2026

Total Delta

375 Total Diff Delta

Open Days

Open 16 weekdays

Test Delta

199 Diff Delta in Test Files
Breakdown by Phase

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

Fraction of total time Business days Phase
 
0 days Authoring 2 commits before pull request opened for review
 
0 days Awaiting first review
 
1 day Revising work with 5 commits in response to 0 reviews that left 2 comments
 
6 days Merge to deploy

Total time for pull request 1 business day from first commit authored to deploy

Author avatar

CmdPal: Safely handle invoking an extension that died

This is an issue I noticed while debugging the dock with a dev build. If I quit out of the dev build, then try to click on a dock item on my stable build. If that item was from an extension, I would no longer be able to run any commands in command palette at all.

Turns out the issue is much bigger than just dock items. It seems if we tried to perform the command for any item from an extension that has died, we would throw an exception outside of the try/catch in ShellViewModel::PerformCommand. That would cause us to never release the _handleInvokeTask, and we'd never be able to start invoking another command.

Looks like the call to command.Unsave.Name got moved from inside the try/catch to outside in #43905. Whoops.

While I was here, I thought it best that we remove this footgun. PerformCommandMessage now carries around a CommandViewModel instead of just an ExtensionObject<ICommand>, so that consumers can use the cached name & Id rather than begging to use .Unsafe on it.

Closes: probably nothing, maybe something though?

Comments Threads Pending Resolution

src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Messages/PerformCommandMessage.cs

Resolved Comment Threads

No resolved comments have been left on this PR.