From 33dbc312b045561f57cf546e34d0b1792db0f7f9 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 1 Mar 2026 00:41:39 +0100 Subject: [PATCH] fix: remove eager beads store initialization at startup The beads store was being opened unconditionally at startup, causing crashes when the database was corrupted or incompatible. Now it's only opened on-demand when actually needed. --- cmd/anvilsrv/main.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/cmd/anvilsrv/main.go b/cmd/anvilsrv/main.go index 5b44ff2..4f7d7b7 100644 --- a/cmd/anvilsrv/main.go +++ b/cmd/anvilsrv/main.go @@ -20,7 +20,6 @@ import ( "time" "9fans.net/go/plan9/client" - bd "github.com/steveyegge/beads" "go.uber.org/zap" ) @@ -212,24 +211,8 @@ func start(daemonize bool) { } }() - // Create shared beads store (namespace-agnostic, persistent on disk) - beadsDir := os.Getenv("ANVILLM_BEADS_PATH") - if beadsDir == "" { - beadsDir = filepath.Join(os.Getenv("HOME"), ".beads") - } - logging.Logger().Debug("initializing beads store", zap.String("path", beadsDir)) - beadsStore, err := bd.OpenFromConfig(context.Background(), beadsDir) - if err != nil { - logging.Logger().Warn("failed to initialize beads store", zap.Error(err)) - beadsStore = nil // Continue without beads support - } - if beadsStore != nil { - defer beadsStore.Close() - logging.Logger().Info("beads store initialized", zap.String("path", beadsDir)) - } - // Start 9P server - srv, err := p9.NewServer(mgr, beadsStore) + srv, err := p9.NewServer(mgr, nil) if err != nil { logging.Logger().Fatal("failed to start 9P server", zap.Error(err)) }