Fix daemon socket failing with EINVAL on long project paths - #219
Open
nsams wants to merge 4 commits into
Open
Conversation
Unix domain socket paths must fit into sockaddr_un.sun_path (108 bytes on Linux, 104 on macOS). In deeply nested projects the path to .pm.sock exceeded that limit, so binding/connecting failed with EINVAL (or ENOENT when the path got truncated). Add src/utils/socket.ts, which opens the socket with a path relative to its directory (temporarily switching the cwd) whenever the absolute path is too long, and use it for both the daemon's listen and the clients' connect. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E17p2FNAxnWQEmZ1XMJ1yu
Instead of deciding per call whether the absolute socket path still fits into sockaddr_un and temporarily switching the cwd around bind()/connect(), the CLI commands now change into the project root - like the daemon already did - and always refer to the socket by its plain file name. Also raise the default per-command timeout of the e2e helper, 1s is not enough for the daemon auto-start on slow machines. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E17p2FNAxnWQEmZ1XMJ1yu
The helper derives the project root from the config file, it has nothing to do with sockets. With it living next to loadConfig the socket file can simply be referenced by its plain name again, so the socket util file is gone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E17p2FNAxnWQEmZ1XMJ1yu
✅ Deploy Preview for dev-process-manager canceled.
|
VPS-Fabi
requested changes
Aug 18, 2026
Shut down the daemon started in the long directory in a finally block, afterEach only takes care of the one in tmpDir. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E17p2FNAxnWQEmZ1XMJ1yu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed an issue where the dev-pm daemon would fail to start or connect when the project path is too long. Unix domain socket paths must fit into
sockaddr_un.sun_path(108 bytes on Linux, 104 bytes on macOS), and deeply nested projects would exceed this limit when using absolute paths.Key Changes
chdirToProjectRoot()utility function inload-config.tsthat changes the working directory to the project root (directory containing the config file)connect.ts,auto-start-daemon.ts, andstart-daemon.command.tsto:chdirToProjectRoot()after loading the config.pm.sock(relative path) instead of constructing an absolute pathrunDevPm()from 1000ms to 5000ms to accommodate slower systemsImplementation Details
.pm.sock), the socket path is always short regardless of the project's location in the filesystemhttps://claude.ai/code/session_01E17p2FNAxnWQEmZ1XMJ1yu