Problem
On WSL2/Windows, a generated Webstudio preview process can survive a previous CLI/MCP session and continue holding files below .webstudio/preview/ through the 9P mount. A later preview regeneration then fails with EPERM while removing or replacing generated files.
This was reported from Claude Code 2.1.222 using Webstudio CLI 0.283.0. Recovery required finding and terminating the Windows-side process through PowerShell.
Desired outcome
Owned preview processes terminate reliably when their CLI/MCP owner stops, disconnects, or exits unexpectedly, and later preview preparation does not fail with opaque filesystem errors when a foreign or orphaned process still owns generated files.
Scope
- Reproduce under WSL2 with the repository preview lifecycle.
- Test normal
preview.stop, MCP transport disconnect, Ctrl-C/SIGINT, failed multi-call runs, and abrupt parent termination.
- Identify whether the orphan is the React Router server, npm launcher, browser process, or a descendant process outside the current process group.
- Stop the complete owned process tree before cleaning generated files.
- When cleanup still fails, report the locked path, likely owning process/PID where discoverable, and a safe recovery instruction.
Constraints
- Do not kill unrelated processes sharing a port or executable name.
- Preserve macOS and Linux process cleanup behavior.
- Keep generated preview cleanup recoverable and scoped to the linked project.
Acceptance criteria
- A WSL integration reproducer fails before the fix and passes afterward.
- No owned preview descendants remain after normal stop or MCP disconnect.
- Repeated preview start/stop/regenerate cycles do not produce
EPERM under the 9P mount.
- Failure diagnostics identify the locked preview path and provide an actionable recovery path without requiring source inspection.
Problem
On WSL2/Windows, a generated Webstudio preview process can survive a previous CLI/MCP session and continue holding files below
.webstudio/preview/through the 9P mount. A later preview regeneration then fails withEPERMwhile removing or replacing generated files.This was reported from Claude Code 2.1.222 using Webstudio CLI 0.283.0. Recovery required finding and terminating the Windows-side process through PowerShell.
Desired outcome
Owned preview processes terminate reliably when their CLI/MCP owner stops, disconnects, or exits unexpectedly, and later preview preparation does not fail with opaque filesystem errors when a foreign or orphaned process still owns generated files.
Scope
preview.stop, MCP transport disconnect, Ctrl-C/SIGINT, failed multi-call runs, and abrupt parent termination.Constraints
Acceptance criteria
EPERMunder the 9P mount.