fix(daemon): handle macOS socket path length limit - #733
Conversation
On macOS Unix domain socket paths are limited to 104 bytes. When project root exceeds this, use a hashed path in temp dir. Add test coverage for the macOS-specific behavior.
|
Hey @egmar, thanks for this PR, and nice catch on the underlying problem. Couple of things to sort out before this goes in: The guard measures the wrong string
const projectSock = join(projectRoot, '.nanocoder', 'daemon.sock');
if (process.platform === 'darwin' && Buffer.byteLength(projectSock) > DARWIN_SOCKET_PATH_CAPACITY) { ... }
return projectSock;The test can't catch that The 205-byte root at Worth rewording the commit message and changeset I went and poked at this because I wanted to understand the failure, and an over-long path doesn't actually fail to bind. On Node 22 / libuv 1.49 the Small stuff, all in
For what it's worth, I traced every Looking forward to reviewing again :) |
Description
On macOS Unix domain socket paths are limited to 104 bytes. When project root exceeds this, the daemon will fail to start and throw an exception in the log.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist