From 09538636415e2ecbd8948705533b5e76db7f8cea 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 244fba80..40ea0252 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