dsh-skill-filesystem: fatal process exit on ELOOP caused by circular junctions in user skill directory #1954
q1023240585-code
started this conversation in
General
Replies: 1 comment
|
Confirmed at source level and implemented as a cherry-pick-ready branch. Source audit (master 47f9438)The report's read is exact: Patch: fix/skill-filesystem-eloop-containedhttps://github.com/zoahdev/deepseek-harness/tree/fix/skill-filesystem-eloop-contained
Verification
Thanks for the exact reproduction - this is exactly the "one corrupted directory must never take down the process" class of bug. Happy to open the PR once contributions are enabled. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh(DeepSeek Harness) crashes with a fatal error and the whole process exits when a user skill directory (e.g.~/.agents/skills) contains circular junctions (directory A points to B while B points back to A). A single corrupted directory should never take down the entire service.Environment
0.1.0-rc.6(package@deepseek-ai/dsh-skill-filesystem)~/.agents/skillsby theskill-filesystemproviderActual behavior
dsh starts, listens on the port, then the Node.js process dies shortly after with:
The browser then fails to connect to the GUI (
failed to fetch).Root cause
The skill watcher in
dsh-skill-filesystem(lib/index.js) creates a chokidar watcher withfollowSymlinks: this.config.followSymlinks(defaulttrue,watchFollowSymlinksconfig):When the watched root contains circular junctions, chokidar follows the cycle and hits
ELOOP. The error handler wired before the watcher is ready rejects the readiness promise, and that rejection is rethrown up the stack:replaceWatcheralso warns but rethrows:So an
ELOOPduring the initial scan escapes as a fatal load failure instead of being contained per-directory.Reproduction (Windows):
Expected behavior
A broken/unreadable skill directory (circular junction, permission error, or any per-directory failure) should:
WARNING(e.g.WARNING: skipping unreadable skill dir ...) and skipped;Suggested fix
readywatcher errors through the same degradation path ashandleWatcherError(warn + mark rootunhealthy+ skip/retry) instead of rejecting the readiness promise and rethrowing.ELOOP/ELOOP-class errors: drop the affected root from the watch set, emit a warning, and optionally re-probe on the next invalidation cycle.watchFollowSymlinksdefault tofalsefor user-level roots, or document the risk.Notes
~/.agents/skillsand~/.claude/skillsinto junctions pointing at each other; dsh died on every startup until the cycles were manually removed.All reactions