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
Reviewing
5 fewer changed lines
(6% less) vs GitHub
This saves about 10.5 hours per year vs conventional diff tools
zadjii-msft authored
of work between October 20 and October 21
Diff Delta:
375
About 22 Diff Delta/hour
Classified as:  Bug Fix, General

zadjii-msft's Description of Work

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?

Building updated commit group diff...
88 total changed files
(13 files ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...