From 78b81341313d487be60fbaaf86afc58ad16b8756 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Fri, 26 Dec 2025 19:15:23 -0800 Subject: [PATCH] fix: bd graph works with daemon running (GH#751) Add direct storage fallback when daemon is running but store is nil, matching the pattern used by dep tree, blocked, and ready commands. --- cmd/bd/graph.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/bd/graph.go b/cmd/bd/graph.go index ec7c8a1a..d4e585dd 100644 --- a/cmd/bd/graph.go +++ b/cmd/bd/graph.go @@ -11,6 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/steveyegge/beads/internal/rpc" "github.com/steveyegge/beads/internal/storage" + "github.com/steveyegge/beads/internal/storage/sqlite" "github.com/steveyegge/beads/internal/types" "github.com/steveyegge/beads/internal/ui" "github.com/steveyegge/beads/internal/utils" @@ -80,6 +81,17 @@ Colors indicate status: os.Exit(1) } + // If daemon is running but doesn't support this command, use direct storage + if daemonClient != nil && store == nil { + var err error + store, err = sqlite.New(ctx, dbPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error: failed to open database: %v\n", err) + os.Exit(1) + } + defer func() { _ = store.Close() }() + } + // Load the subgraph subgraph, err := loadGraphSubgraph(ctx, store, issueID) if err != nil {