DeepSeek Harness Windows 0xC0000142: desktop vs dsh web
A plain echo ok returns 0xC0000142 under workspace-write in the Windows desktop app, with not a single byte on stdout or stderr — the command is not wrong; the restricted child process died during DLL initialization. On the same DSH and the same machine, launching through dsh web works, and that single comparison narrows the field to the host shape. The community reproduced the same pattern on both Windows 11 26200 and Windows 10 19045 (#10483, #10706).
DeepSeek Harness: Triage: ask three questions before touching config
Ask the three questions in order: does the desktop app fail, does dsh web fail, and is it every exe or only PowerShell? The combination of answers usually lands on one of three causes.
- In the desktop app, create a session, choose "write in workspace", and have the agent run
echo ok; record the exit code. Seeing3221225794or0xC0000142puts you in this family. - Rerun the same command under "full access" (danger-full-access). If it works, token construction, ACLs, and paths are fine and the fault is only on the restricted path.
- Launch the same workspace through
dsh web(the Node host), switch to workspace-write, and run it again. This step is the dividing line for the whole article. - If you have a launch flag like
--no-sandbox, try it once; if that starts, you are looking at Chromium's install-directory check, which is out of scope here.
Read the comparison results straight off the table:
| Desktop | dsh web | Direction |
|---|---|---|
| Always fails | Works | Missing console (cause 1) |
| Always fails | Works, and only PowerShell fails | PowerShell's console dependency |
| Always fails | Always fails | Path DACL (cause 3) |
Starts with --no-sandbox | — | Install directory ACL, covered elsewhere |
DSH plugin: Cause 1: the GUI host has no console, so the restricted child cannot start
The desktop app is an Electron GUI subsystem process and has no console by nature; under a restricted token the child cannot create a usable console either, conhost initialization fails, and the process exits during DLL initialization — hence zero output.
- Confirm the host type: in Task Manager, look at the parent of
DeepSeek Harness.exe; if it isexplorer.exe, the app was started as a GUI. - Rerun the same command in the same workspace through
dsh web. The web build is started bynode.exeand inherits a real console from the terminal, so the whole runner chain has one. - If the web build works, the "host has no console" explanation is confirmed and you do not need to touch ACLs.
- When the community checked the source, they also inspected the release package: the current build's
app.asarcontains zero occurrences ofensureWindowsConsoleHostandAllocConsole, meaning the trampoline fix that gives Electron a console (a1caef3) did not make it into this build.
This also explains why "starting the desktop app from a terminal" fails the same way: a GUI subsystem process does not attach to the parent's console.
DeepSeek Harness: Cause 2: CREATE_NEW_CONSOLE is the actual failure point
A restricted token plus "needs a new console" always fails; inheriting an existing console, or creating none at all, starts normally. Six host/flag combinations pinned this down.
The community ran an A–F comparison that changed only the host process and creationFlags:
| Group | Host | Flags | Result |
|---|---|---|---|
| A | node.exe (has console) | 0 (inherit) | Success |
| B | node.exe | CREATE_NEW_CONSOLE | 0xC0000142 |
| C | node.exe | DETACHED_PROCESS | Success |
| D | DeepSeek Harness.exe (GUI) | 0 (forced new console) | 0xC0000142 |
| E | DeepSeek Harness.exe | DETACHED_PROCESS | cmd succeeds |
| F | DeepSeek Harness.exe | 0 | powershell 5.1 fails |
Two follow-up experiments are worth remembering: after adding a hidden console to the runner (AllocConsole + SW_HIDE), PowerShell built-ins ran, but external programs launched from it still failed; switching to DETACHED_PROCESS let cmd run, yet PowerShell would not even execute -Command, because its ConsoleHost needs a real console.
So "just add a hidden console" is only half right: it proves the root cause but does not fix handle inheritance.
DSH Plugin: Cause 3: path DACL carries a foreign package SID — run the bundled script
If every command fails regardless of content or cwd, consider the third cause: a path the child must read has a DACL containing another AppContainer tool's package SID, which the low-integrity token cannot open.
The official package README (packages/sandbox/sandbox-windows-acl/README.md) documents two causes and one structural limitation:
- The keep-alive group (logon SID + Everyone) is missing from the token.
- The child is created with
CREATE_NO_WINDOW/CREATE_NEW_CONSOLE, and the README notes console isolation is unavailable. - The path DACL carries a foreign package SID — earlier sandbox tools or an older DSH may have stamped the workspace or install tree, which triggers this one.
For the third case the package ships a diagnostic and repair script, run as a non-restricted identity:
& '<skill-dir>\scripts\diagnose-windows-sandbox-acl.ps1' `
-Path '<workspace-or-install-dir>' `
-RecoveryDir '<recovery-dir>'
The script backs up and verifies every DACL change, removes foreign package ACEs at the source, refuses reparse points and managed app directories, and finally prints a rollback command. The rc.2 (687f282e) release package already includes this script, so you do not need to wait for rc.3.
DeepSeek Harness: Why uninstalling and reinstalling does not help
ACLs live on directories, not in program files; the uninstaller will not add ACEs and clearing AppData will not either. So "reinstall once" does nothing for any of the three causes.
- Do not reinstall yet; confirm the direction with the triage table above.
- When you need the repair script, run it from a non-restricted PowerShell window, not from a shell inside the DSH sandbox.
- The script requires
RecoveryDir; keep the backup and roll back with the command it prints if something goes wrong. - If the script reports "nothing to repair", you are not in cause 3 — go back to cause 1 or 2.
- A separate "app will not start after reinstall" problem is left behind by the uninstaller and is not the same as the shell's 0xC0000142; do not debug them together.
DSH plugin: Cautions
Do not turn a triage result into a permanent configuration.
- Do not let danger-full-access become the long-term answer. It is a triage tool, not a fix.
- Do not change tokens, ACLs, and launch flags at the same time. One variable at a time, or reproductions mean nothing.
- Use
--no-sandboxonly as a signal. If it starts, you are in the install-directory access-check layer; running that way long-term disables the browser sandbox. - Windows 10 and Windows 11 both hit it. The community reproduced it on 19045 and 22621, so do not treat it as an OS-version threshold.
- Record the version number and commit first. Differences between rc.2 and rc.3 affect whether you can tell if it is already fixed.
If dsh web works and the desktop app does not, the easiest temporary option is to keep working in the web build; staying on desktop means waiting for the host side to add the console trampoline.See DSH plugin: Windows subprocess fails with 0xC0000142 for the related case.
FAQ
Start DeepSeek Harness triage with the host comparison: execute the same echo ok once in the desktop app and once through dsh web. Desktop failing while dsh web works points to the GUI host having no console; only when both fail should you inspect the path DACL. This comparison saves more time than any config change.
Launching from a terminal changes nothing here, because the DeepSeek Harness desktop app is an Electron GUI subsystem process that does not attach to the parent terminal's console. In the community experiments, group A (node host inheriting a console) started while group D (GUI host forced to create a console) always failed; the difference is host shape, not how you launched it.
Yes, CREATE_NEW_CONSOLE is a real trigger for 0xC0000142 in DeepSeek Harness: across the community's six-way comparison, restricted children failed whenever they had to create a new console, and succeeded when they inherited one or created none. Giving the runner a hidden console made PowerShell built-ins run, but launching external programs from there still failed.
The DeepSeek Harness script diagnose-windows-sandbox-acl only helps when the path DACL carries another AppContainer package SID. The script ships with the package; run it from a non-restricted identity with -Path and -RecoveryDir, and it backs up before changing anything and prints a rollback command. If it reports nothing to repair, you are not in this category.
No, uninstalling and reinstalling DeepSeek Harness cannot fix the workspace-write 0xC0000142 because ACLs live on directories rather than on program files, so the uninstaller will not add ACEs and clearing AppData will not either. The community check was explicit that a reinstall cannot fix any of the three causes; use the triage table instead.
Related Terms
- 0xC0000142
- 0xC0000142 is the Windows STATUS_DLL_INIT_FAILED exit code, meaning the process failed in the loader/DLL initialization stage, before it could produce any stdout or stderr. In sandbox scenarios it usually points to console creation or a restricted token rather than a bad command.— https://github.com/deepseek-ai/deepseek-harness/discussions/10483
- workspace-write
- workspace-write is a DeepSeek Harness file policy that allows writes inside the workspace and read-only access outside it, isolating work through restricted tokens and ACLs. It promises a write boundary, not that processes cannot initialize, so an initialization failure is a defect.— https://github.com/deepseek-ai/deepseek-harness
- CREATE_NEW_CONSOLE
- CREATE_NEW_CONSOLE is a Windows CreateProcess creation flag that allocates a new console for the child. Under a restricted token, creating a new console fails during conhost initialization, making it one of the known triggers for 0xC0000142.— https://github.com/deepseek-ai/deepseek-harness/discussions/10706
- diagnose-windows-sandbox-acl.ps1
- `diagnose-windows-sandbox-acl` is the diagnostic and repair script bundled with the deepseek-harness sandbox package, used to inspect and clean foreign AppContainer package ACEs from path DACLs. It must run as a non-restricted identity, backs up and verifies each change, and refuses to process reparse points.— https://github.com/deepseek-ai/deepseek-harness/discussions/10789
Sources
- #10483 — workspace-write makes every confined command exit 0xC0000142· deepseek-ai (GitHub Discussions)
- #10706 — Windows 10 19045: workspace sandbox mode cannot start a shell (0xC0000142)· deepseek-ai (GitHub Discussions)
- #10789 — the three documented causes and the bundled diagnostic script· deepseek-ai (GitHub Discussions)
- #10898 — shell tool fails 100% of the time; the app will not start after reinstall· deepseek-ai (GitHub Discussions)
- deepseek-ai/deepseek-harness (source and sandbox README)· GitHub