When using short socket paths (workspaces with paths >103 chars), filepath.Dir(socketPath) returns /tmp/beads-XXXXX/ instead of the actual .beads/ directory. This caused TryDaemonLock to look in the wrong location, always return false, clean up the startlock, and recurse infinitely causing stack overflow. Changed 4 occurrences in acquireStartLock, handleStaleLock, handleExistingSocket, and getPIDFileForSocket to use filepath.Dir(dbPath) which correctly points to .beads/. Fixes: gt-qlt Co-authored-by: furiosa <mayor@gastown.local> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
16 KiB
16 KiB