Qwen Code bug: dangling worktree sidecars silently orphan checkouts on session deletion

wenshao · ghdev · 2026-11-27

Issue #18475 on QwenLM/qwen-code reports a fail-open defect: deleting a session that owns a managed worktree silently removes the transcript while leaving the checkout and an unreadable worktree sidecar behind. In the reproduced case the sidecar was a dangling symlink, yet deletion returned removed: [id] with errors: [] and no warning.

The root cause is that the session-delete fast path treats any existsSync miss as "no sidecar", conflating dangling symlinks and other stat failures with a genuinely absent entry. The reporter asks for fail-closed semantics: refuse with a clear error and preserve the record, or complete a fully verified cleanup — only a real ENOENT should use the fast path. The bug was independently reproduced while verifying PR #18454 and pre-exists on main.

Original post →

More from coding & agent

coding & agent channel →