Workspace Trust prompt shown on every restore/reopen/reconnect of an already-trusted Remote-SSH folder
## Environment - VS Code 1.140.0 (commit 07f806f999227108933c2e30515b26eecc1fda74), Windows 11 x64 client - Remote - SSH 0.128.0 - Remote host: Windows 11, built-in OpenSSH server - `security.workspace.trust.enabled`: true (default); no profiles; Settings Sync off ## Steps to reproduce 1. Remote-SSH: Connect to Host, open folder `C:\Project` on the remote, click "Yes, I trust the authors". 2. Confirm in *Workspaces: Manage Workspace Trust* that the row `SSH: C:\Project` is listed under Trusted Folders. 3. Close the window, then reopen `Project [SSH: ]` from File > Open Recent (or restart VS Code with that window open so it is restored). ## Expected No trust prompt; the folder is already trusted. ## Actual The Workspace Trust modal appears every time (step 3), even though the folder is still listed as trusted once connected. It also appears every time the SSH connection drops and is re-established in an open window. A fresh "Connect to Host" (no folder) never prompts. Setting `"security.workspace.trust.startupPrompt": "never"` does not suppress it. ## Observations - In 1.140 the trust list is stored in `%APPDATA%\Code\User\globalStorage\agent-host-config.json` → `workspaceTrust.trustedUris`. On the client this list contains only `file:///` URIs. - The trust for the remote folder is persisted on the **remote**, in `~/.vscode-server/data/User/globalStorage/agent-host-config.json`, as `"file:///c%3A/Project"`. The remote server's agent-host protocol logs (`data/logs/*/ahp/*.jsonl`) show it present in every session after it was first granted. - Adding `"vscode-remote://ssh-remote%2B /c%3A/Project"` by hand to the client's `trustedUris` (with VS Code closed) does not help: on next start VS Code rewrites the file and drops the entry, and the prompt still appears. - The old `content.trust.model.key` entry in `globalStorage/state.vscdb` no longer exists (only a deleted remnant remains in the file). ## Likely cause (inferred, not verified in source) On restore/reopen, trust for the `vscode-remote://` folder is evaluated before the remote authority has resolved. At that point only the client's list is available, and it can never contain remote URIs, so the folder is treated as untrusted and the startup prompt is shown. The remote's list, which does contain the folder, is only consulted after the connection is established. ## Possibly related With `remote.SSH.useLocalServer: false`, reopening/restoring the same window frequently failed to connect at all: Remote-SSH logged `Running script with connection command: ... ssh.exe ...` but ptyhost never spawned the hidden terminal (no `ssh.exe` process was created, nothing reached the host's sshd), and the resolver timed out after `remote.SSH.connectTimeout`. A fresh "Connect to Host" spawned it immediately. `remote.SSH.useLocalServer: true` avoids this. The failure and the trust prompt occurred in the same reopen/restore scenarios; whether one causes the other was not established.