fix(daemon): normalize paths for case-insensitive filesystem comparison (GH#869)

On macOS and Windows, filesystems are typically case-insensitive, so
/Users/foo/Desktop and /Users/foo/desktop refer to the same directory.
The daemon registry and discovery code was doing direct string comparison,
causing path mismatches when the casing differed.

Fix:
- Add NormalizePathForComparison() and PathsEqual() to internal/utils/path.go
- These resolve symlinks and lowercase paths on darwin/windows
- Update all workspace path comparisons in registry.go, discovery.go, and
  daemons.go to use PathsEqual()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
wolf
2026-01-03 13:22:52 -08:00
committed by Steve Yegge
parent a791991103
commit 631b067c1c
5 changed files with 194 additions and 6 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import (
"github.com/steveyegge/beads/internal/lockfile"
"github.com/steveyegge/beads/internal/rpc"
"github.com/steveyegge/beads/internal/utils"
)
// walkWithDepth walks a directory tree with depth limiting
@@ -229,7 +230,8 @@ func FindDaemonByWorkspace(workspacePath string) (*DaemonInfo, error) {
}
for _, daemon := range daemons {
if daemon.WorkspacePath == workspacePath && daemon.Alive {
// Use PathsEqual for case-insensitive comparison on macOS/Windows (GH#869)
if utils.PathsEqual(daemon.WorkspacePath, workspacePath) && daemon.Alive {
return &daemon, nil
}
}