Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes/No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version:1.58.0 OS Version:MacOS Big Sur Steps to Reproduce: an untrusted folder (in my case, containing a VS Code Extension repo) command dialog appears, saying that "Listing and running tasks requires that some of the files in this workspace be executed as code...." the button banner is removed from VS Code window, but the dialog remains the button again the dialog closes, and the Task starts If instead of clicking the button twice (step 6), you simply close the dialog (click the X button), the build task starts normally (as it should, because I already trusted the folder) Thank you
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.531 --- <!-- score: 0.467 --- <!-- score: 0.457 --- <!-- score: 0.453 --<!-- potentialduplicatescomment --
The command hits two task entry points where I check for , but I thought that when I call on the second one it would just return . should I be checking if the workspace is already trusted before calling ?
I have looked into this and the issue is in the workspace trust service. Due to a regression introduced last milestone, we resolve the promise for before the workspace has fully transitioned from untrusted to trusted. I am working on a fix now.
Fix has been merged to the release branch.

Discussion:
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { Emitter } from 'vs/base/common/event'; </del> <ins> import { Emitter, Event } from 'vs/base/common/event'; </ins> import { splitName } from 'vs/base/common/labels'; import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { LinkedList } from 'vs/base/common/linkedList';

return; } <del> // Update storage, transition workspace, and resolve the promise </del> <ins> // Register one-time event handler to resolve the promise when workspace trust changed Event.once(this.workspaceTrustManagementService.onDidChangeTrust)(trusted => this.resolveWorkspaceTrustRequest(trusted)); // Update storage, transition workspace state </ins> await this.workspaceTrustManagementService.setWorkspaceTrust(trusted); <del> this.resolveWorkspaceTrustRequest(trusted); </del> } async requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean | undefined> {