You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dev server restarts when another worktree installs dependencies #544
A dev server under test restarts itself whenever another worktree installs or removes its node_modules. The restart cancels live agent turns and breaks the browser session, with nothing changed in the worktree being tested.
J5 creates and removes worktrees constantly, so this hits most long live tests. Past test sessions logged 29 to 31 restarts each, and one cancelled a real Claude turn.
Cause
apps/server/package.json runs the dev server as node --watch src/bin.ts. On Linux that watches every file the server has loaded, including about 1,200 files under node_modules/.pnpm. pnpm hardlinks those files from its shared store, so each worktree's copy is the same inode. When another worktree links or unlinks them, the link count changes, inotify fires, and Node restarts.
Evidence from 2026-10-11:
The watcher of a running dev server had 2,300 watched files: 1,064 source files and 1,236 under node_modules/.pnpm, 708 of them hardlinked to the store. State, sqlite files and build output were not watched.
A restart at 13:52:38 local lined up with another worktree's install starting at 13:52:37.998.
Reproduced in a scratch directory: ln of a loaded file caused a restart, and so did rm of that link. With --watch --watch-path=./src neither did, and a real edit under src still restarted.
Before merging, check that the recursive watch on packages does not follow the node_modules symlinks back in.
This is a one-line edit to an upstream-owned file, so it needs a FORK.md entry. Upstream has no no-watch switch and no issue about this, and would hit the same problem with any two pnpm worktrees, so it is a candidate to offer back (#276).
Jackson approved narrowing the watch on 2026-10-11.
Activity
fix(server): another worktree's install no longer restarts a dev serv…