Change:
I created a brand new VM and attached remote-ssh to it, then opened my folder on it. I clicked to trust the folder, then immediately after I was prompted by the terminal to trust the folder again. Every time I open a new folder thereafter I'm again double prompted for trust.
this is how we use the API, is promise for the original prompt not being shared with successive requests or something?
All callers of should be sharing the same promise. I will try to set up a repro today and see if I can reproduce the problem locally.
Here is what is happening: initial workspace trust modal dialog is being displayed there is another workspace trust dialog displayed due to the call the workspace will actually resolve the promise and in the background you can see the terminal is initiated The workspace trust request dialog is not being dismissed. I do have couple of ideas that I will discuss with
The fix will be available in Friday's Insiders release.

Discussion:
readonly onDidInitiateOpenFilesTrustRequest: Event<void>; readonly onDidInitiateWorkspaceTrustRequest: Event<WorkspaceTrustRequestOptions | undefined>; <ins> readonly onDidInitiateWorkspaceTrustRequestOnStartup: Event<void>; </ins> completeOpenFilesTrustRequest(result: WorkspaceTrustUriResponse, saveResponse?: boolean): Promise<void>; requestOpenFilesTrust(openFiles: URI[]): Promise<WorkspaceTrustUriResponse>;

cancelWorkspaceTrustRequest(): void; completeWorkspaceTrustRequest(trusted?: boolean): Promise<void>; requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean | undefined>; <ins> requestWorkspaceTrustOnStartup(): void; </ins> } export interface IWorkspaceTrustTransitionParticipant {

this._register(this.workspaceTrustManagementService.onDidChangeTrust(trusted => { this.updateWorkbenchIndicators(trusted); })); <ins> this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequestOnStartup(() => { const title = this.useWorkspaceLanguage ? localize('workspaceTrust', "Do you trust the authors of the files in this workspace?") : localize('folderTrust', "Do you trust the authors of the files in this folder?"); let checkboxText: string | undefined; const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace())!; const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier); if (this.workspaceTrustManagementService.canSetParentFolderTrust()) { const { name } = splitName(splitName((workspaceIdentifier as ISingleFolderWorkspaceIdentifier).uri.fsPath).parentPath); checkboxText = localize('checkboxString', "Trust the authors of all files in the parent folder '{0}'", name); } // Show Workspace Trust Start Dialog this.doShowModal( title, { label: localize('trustOption', "Yes, I trust the authors"), sublabel: isSingleFolderWorkspace ? localize('trustFolderOptionDescription', "Trust folder and enable all features") : localize('trustWorkspaceOptionDescription', "Trust workspace and enable all features") }, { label: localize('dontTrustOption', "No, I don't trust the authors"), sublabel: isSingleFolderWorkspace ? localize('dontTrustFolderOptionDescription', "Browse folder in restricted mode") : localize('dontTrustWorkspaceOptionDescription', "Browse workspace in restricted mode") }, [ !isSingleFolderWorkspace ? localize('workspaceStartupTrustDetails', "{0} provides features that may automatically execute files in this workspace.", this.productService.nameShort) : localize('folderStartupTrustDetails', "{0} provides features that may automatically execute files in this folder.", this.productService.nameShort), localize('startupTrustRequestLearnMore', "If you don't trust the authors of these files, we recommend to continue in restricted mode as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."), ``${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose: true })}``, ], checkboxText ); })); </ins> } private updateWorkbenchIndicators(trusted: boolean): void {

return; } <del> const title = this.useWorkspaceLanguage ? localize('workspaceTrust', "Do you trust the authors of the files in this workspace?") : localize('folderTrust', "Do you trust the authors of the files in this folder?"); let checkboxText: string | undefined; const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace())!; const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier); if (this.workspaceTrustManagementService.canSetParentFolderTrust()) { const { name } = splitName(splitName((workspaceIdentifier as ISingleFolderWorkspaceIdentifier).uri.fsPath).parentPath); checkboxText = localize('checkboxString', "Trust the authors of all files in the parent folder '{0}'", name); } // Show Workspace Trust Start Dialog this.doShowModal( title, { label: localize('trustOption', "Yes, I trust the authors"), sublabel: isSingleFolderWorkspace ? localize('trustFolderOptionDescription', "Trust folder and enable all features") : localize('trustWorkspaceOptionDescription', "Trust workspace and enable all features") }, { label: localize('dontTrustOption', "No, I don't trust the authors"), sublabel: isSingleFolderWorkspace ? localize('dontTrustFolderOptionDescription', "Browse folder in restricted mode") : localize('dontTrustWorkspaceOptionDescription', "Browse workspace in restricted mode") }, [ !isSingleFolderWorkspace ? localize('workspaceStartupTrustDetails', "{0} provides features that may automatically execute files in this workspace.", this.productService.nameShort) : localize('folderStartupTrustDetails', "{0} provides features that may automatically execute files in this folder.", this.productService.nameShort), localize('startupTrustRequestLearnMore', "If you don't trust the authors of these files, we recommend to continue in restricted mode as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."), ``${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose: true })}``, ], checkboxText ); </del> <ins> // Use the workspace trust request service to show modal dialog this.workspaceTrustRequestService.requestWorkspaceTrustOnStartup(); </ins> } private get startupPromptSetting(): 'always' | 'once' | 'never' {

private readonly _onDidInitiateWorkspaceTrustRequest = this._register(new Emitter<WorkspaceTrustRequestOptions | undefined>()); readonly onDidInitiateWorkspaceTrustRequest = this._onDidInitiateWorkspaceTrustRequest.event; <ins> private readonly _onDidInitiateWorkspaceTrustRequestOnStartup = this._register(new Emitter<void>()); readonly onDidInitiateWorkspaceTrustRequestOnStartup = this._onDidInitiateWorkspaceTrustRequestOnStartup.event; </ins> constructor( @IConfigurationService private readonly configurationService: IConfigurationService, @IWorkspaceTrustManagementService private readonly workspaceTrustManagementService: IWorkspaceTrustManagementService

return this._workspaceTrustRequestPromise; } <ins> requestWorkspaceTrustOnStartup(): void { if (!this._workspaceTrustRequestPromise) { // Create promise this._workspaceTrustRequestPromise = new Promise(resolve => { this._workspaceTrustRequestResolver = resolve; }); } this._onDidInitiateWorkspaceTrustRequestOnStartup.fire(); } </ins> //#endregion }

private readonly _onDidInitiateWorkspaceTrustRequest = new Emitter<WorkspaceTrustRequestOptions>(); readonly onDidInitiateWorkspaceTrustRequest = this._onDidInitiateWorkspaceTrustRequest.event; <ins> private readonly _onDidInitiateWorkspaceTrustRequestOnStartup = new Emitter<void>(); readonly onDidInitiateWorkspaceTrustRequestOnStartup = this._onDidInitiateWorkspaceTrustRequestOnStartup.event; </ins> constructor(private readonly _trusted: boolean) { } requestOpenUrisHandler = async (uris: URI[]) => {

async requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean> { return this._trusted; } <ins> requestWorkspaceTrustOnStartup(): void { throw new Error('Method not implemented.'); } </ins> }