Repository navigation
Bug report: Windows windows-acl sandbox dies permanently for a session when its cached private temp dir disappears #6483
|
Product: 1. SymptomEvery confined (Structured error: Two things make this worse than it looks:
2. Root cause
// node_modules/@deepseek-ai/dsh-sandbox-local/lib/index.js (0.1.5-rc.2, lines ~400-403)
const key = JSON.stringify([String(sessionId), workspaceRoot]);
const existing = this.tempCapabilities.get(key);
if (existing !== void 0) return existing; // <-- cached dead path is returned forever
const tempDir = mkdtempSync(join(tmpdir(), "dsh-"));The runner then fails closed on its very first pre-flight check The deletion itself comes from DSH's own cleanup: in the whole installed tree the only code that removes
Once such a removal happens while the provider instance (and therefore its 3. Evidence3.1 The backend works on this host (same process, minutes apart)Current session, confined
Roughly 40 confined commands in that session succeeded with zero runner failures. 3.2 Two affected sessions, months apart (so not a 0.1.5 regression)Logs live at
In 3.3 The "it works again afterwards" is escalation, not recoveryThe successful commands interleaved with the failures are unconfined β the model escalated, with the {"type":"approval/asked","seq":1249,"toolName":"pwsh",
"reason":"escalate sandbox to danger-full-access: The workspace-write sandbox runner is unusable
(its temp directory no longer exists), so this Ren'Py lint check cannot run any other way; β¦"}( 3.4 Ruled out
4. Suggested fixRe-validate the cached capability before returning it (this is the local hotfix we are running, marked const existing = this.tempCapabilities.get(key);
if (existing !== void 0) {
if (existsSync(existing.dir)) return existing;
try { existing.grant.dispose(); } catch {}
this.tempCapabilities.delete(key);
}
const tempDir = mkdtempSync(join(tmpdir(), "dsh-"));( Two secondary suggestions that would have shortened this diagnosis a lot:
5. Environment / repro notes
|
Replies: 2 comments
|
I verified your report against master (c291e79, 2026-09-10). It holds, line Verified facts:
Status and workaround:
|
|
Still reproduces on One extra data point on the recovery half, which suggests this is not purely a stale-path problem. Recreating the missing directory by hand at the exact path named in the error does not fully restore the session:
So the cached entry is not just a path: the capability ACE ( Two concrete suggestions:
Happy to run an instrumented build or add logging if that helps pin down which cleanup path ( |
I verified your report against master (c291e79, 2026-09-10). It holds, line
for line, and it is still unfixed upstream.
Verified facts:
const existing = this.tempCapabilities.get(key); if (existing !== undefined) return existingβ no existsSync/statSync beforereturning the cached { dir, writeSid, grant }, so a deleted dir is re-served
forever (this is the lib ~400-403 you quoted).
src/runner.ts:109-120: requireDirectory β existsSync/statSync β
fail("<label> is not an existing directory: <path>"), with the--tempcheck at :120. Eβ¦