From b41a5ef24354fc9e42346a2c0a4af8642f411444 Mon Sep 17 00:00:00 2001 From: Dustin Smith Date: Mon, 19 Jan 2026 21:36:28 +0700 Subject: [PATCH] fix: verify .beads directory exists after bd init bd init can exit with code 0 but fail to create the .beads directory when orphaned bd daemons interfere. Add explicit verification that the directory exists, with a helpful error message if not. --- internal/cmd/install.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/cmd/install.go b/internal/cmd/install.go index d993ae0c..c6e6d58c 100644 --- a/internal/cmd/install.go +++ b/internal/cmd/install.go @@ -399,6 +399,12 @@ func initTownBeads(townPath string) error { } } + // Verify .beads directory was actually created (bd init can exit 0 without creating it) + beadsDir := filepath.Join(townPath, ".beads") + if _, statErr := os.Stat(beadsDir); os.IsNotExist(statErr) { + return fmt.Errorf("bd init succeeded but .beads directory not created (check bd daemon interference)") + } + // Explicitly set issue_prefix config (bd init --prefix may not persist it in newer versions). prefixSetCmd := exec.Command("bd", "config", "set", "issue_prefix", "hq") prefixSetCmd.Dir = townPath