From 97564dfc13f16ad38c5a71429f94a16e35d4dfe6 Mon Sep 17 00:00:00 2001 From: Johann Taberlet Date: Tue, 6 Jan 2026 04:14:23 +0100 Subject: [PATCH] fix: Initialize git before beads to enable repo fingerprint (#180) Fix: Initialize git before beads to enable repo fingerprint computation Fixes #25 --- internal/cmd/install.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/cmd/install.go b/internal/cmd/install.go index 61c25c7d..6365cbca 100644 --- a/internal/cmd/install.go +++ b/internal/cmd/install.go @@ -188,6 +188,15 @@ func runInstall(cmd *cobra.Command, args []string) error { fmt.Printf(" ✓ Created .claude/settings.json\n") } + // Initialize git BEFORE beads so that bd can compute repository fingerprint. + // The fingerprint is required for the daemon to start properly. + if installGit || installGitHub != "" { + fmt.Println() + if err := InitGitForHarness(absPath, installGitHub, !installPublic); err != nil { + return fmt.Errorf("git initialization failed: %w", err) + } + } + // Initialize town-level beads database (optional) // Town beads (hq- prefix) stores mayor mail, cross-rig coordination, and handoffs. // Rig beads are separate and have their own prefixes. @@ -234,14 +243,6 @@ func runInstall(cmd *cobra.Command, args []string) error { fmt.Printf(" ✓ Created .claude/commands/ (slash commands for all agents)\n") } - // Initialize git if requested (--git or --github implies --git) - if installGit || installGitHub != "" { - fmt.Println() - if err := InitGitForHarness(absPath, installGitHub, !installPublic); err != nil { - return fmt.Errorf("git initialization failed: %w", err) - } - } - fmt.Printf("\n%s HQ created successfully!\n", style.Bold.Render("✓")) fmt.Println() fmt.Println("Next steps:")