refactor: remove deprecated global daemon support

Global daemon support has been deprecated for most of the project's
lifetime. This change removes the dead code entirely:

- Remove --global and --migrate-to-global daemon flags
- Remove runGlobalDaemon() and migrateToGlobalDaemon() functions
- Remove shouldUseGlobalDaemon() and getGlobalBeadsDir() functions
- Simplify functions that had global bool parameters
- Remove warning about old global socket in getSocketPath()

This reduces code complexity and removes 238 net lines of unused code.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-24 23:39:30 -08:00
parent 58f767121d
commit f3e1268b33
5 changed files with 68 additions and 306 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"os"
"os/signal"
"path/filepath"
"time"
"github.com/steveyegge/beads/internal/rpc"
@@ -40,39 +39,6 @@ func startRPCServer(ctx context.Context, socketPath string, store storage.Storag
return server, serverErrChan, nil
}
// runGlobalDaemon runs the global routing daemon
func runGlobalDaemon(ctx context.Context, log daemonLogger) {
globalDir, err := getGlobalBeadsDir()
if err != nil {
log.log("Error: cannot get global beads directory: %v", err)
os.Exit(1)
}
socketPath := filepath.Join(globalDir, "bd.sock")
serverCtx, cancel := context.WithCancel(ctx)
defer cancel()
server, _, err := startRPCServer(serverCtx, socketPath, nil, globalDir, "", log)
if err != nil {
return
}
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, daemonSignals...)
defer signal.Stop(sigChan)
sig := <-sigChan
log.log("Received signal: %v", sig)
log.log("Shutting down global daemon...")
cancel()
if err := server.Stop(); err != nil {
log.log("Error stopping server: %v", err)
}
log.log("Global daemon stopped")
}
// checkParentProcessAlive checks if the parent process is still running.
// Returns true if parent is alive, false if it died.
// Returns true if parent PID is 0 or 1 (not tracked, or adopted by init).