Repository navigation
Description
Does this issue occur when all extensions are disabled? Untested. The watcher observed here was associated with the built-in vscode.terminal-suggest extension, which activated via onTerminalShellIntegration:*.
- VS Code version: 1.147.0 (
8a14f0cc1b08d531eb83255ea3764ae22aa932b5). I verified this version reopened the same directory handle after restarting VS Code. I did not verify the exact VS Code build running during the initial updater failure. - OS: Windows 11 x64, build 26300.9974, NTFS.
Steps to reproduce
- Install DeepSeek Harness Desktop 0.2.2-rc.3 on Windows and register its
dshcommand. Verify that<install root>\resources\runtime\cli\binis on the userPATH. - Open VS Code in an unrelated workspace and start an integrated terminal with shell integration active.
- Upgrade Harness to 0.2.2-rc.5 while leaving VS Code open. The same failure occurred when I ran the downloaded installer separately, with Harness fully exited and the installer started outside the install directory.
Actual behavior
The installer tries to rename its old install root to a sibling backup. MoveFileExW repeatedly returns ERROR_ACCESS_DENIED (5). The VS Code file-watcher utility process held an open handle to the CLI directory under that root (access mask 0x00100081). Once the watcher process exited, I could rename the root, and the same signed installer installed 0.2.2-rc.5 at the original path. After reopening VS Code, the new watcher process opened a handle to the same CLI path.
This looks consistent with watchPathDirectories() in the terminal-suggest extension, which registers watchers for directories on PATH.
Expected behavior
With VS Code and an integrated terminal open, an unrelated installer should be able to rename an application directory whose child is on PATH. Could the Windows terminal-suggest cache detect changes without a long-lived directory handle that prevents this rename?
Filesystem reproduction without the installer
On the same machine, I reproduced the underlying Windows behavior in a temporary directory with Node.js 26.13.0. Running the following prints Watcher active: EPERM followed by Watcher closed: OK.
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const { once } = require('node:events');
(async () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'watcher-rename-'));
let app = path.join(root, 'app');
const backup = path.join(root, 'app.old');
fs.mkdirSync(path.join(app, 'bin'), { recursive: true });
const watcher = fs.watch(path.join(app, 'bin'), () => {});
function rename() {
try {
fs.renameSync(app, backup);
app = backup;
return 'OK';
} catch (error) {
return error.code;
}
}
console.log('Watcher active:', rename());
const closed = once(watcher, 'close');
watcher.close();
await closed;
if (app !== backup) console.log('Watcher closed:', rename());
fs.rmdirSync(path.join(app, 'bin'));
fs.rmdirSync(app);
fs.rmdirSync(root);
})().catch((error) => { console.error(error); process.exitCode = 1; });Related to #331457. That issue tracks stale completions after a PATH-directory replacement. Here, the open handle prevents the parent-directory rename.
Related Harness installer discussion: deepseek-ai/deepseek-harness#9989
Activity