fix: kill orphaned bd daemons before beads init

Stale bd daemon processes from previous installs can interfere with
fresh database creation, causing "issue_prefix config is missing"
and "no beads database found" errors during install.
This commit is contained in:
Dustin Smith
2026-01-19 21:22:46 +07:00
parent b28c25b8a2
commit 4eb3915ce9

View File

@@ -258,6 +258,12 @@ func runInstall(cmd *cobra.Command, args []string) error {
// Town beads (hq- prefix) stores mayor mail, cross-rig coordination, and handoffs.
// Rig beads are separate and have their own prefixes.
if !installNoBeads {
// Kill any orphaned bd daemons before initializing beads.
// Stale daemons can interfere with fresh database creation.
if killed, _, _ := beads.StopAllBdProcesses(false, true); killed > 0 {
fmt.Printf(" ✓ Stopped %d orphaned bd daemon(s)\n", killed)
}
if err := initTownBeads(absPath); err != nil {
fmt.Printf(" %s Could not initialize town beads: %v\n", style.Dim.Render("⚠"), err)
} else {