From bfffc47715f0b3dccde0d0855e64ec7474628d47 Mon Sep 17 00:00:00 2001 From: jasper Date: Sat, 24 Jan 2026 17:25:11 -0800 Subject: [PATCH] fix(sqlite): respect --lock-timeout flag in direct mode (bd-2zd.4) The ensureStoreActive() function was ignoring the user-configured --lock-timeout flag and always using the 30s default via sqlite.New(). This fix changes ensureStoreActive() to use sqlite.NewWithTimeout() with the configured lockTimeout, allowing users to specify shorter timeouts for multi-agent scenarios. With this change, users can now run: bd --lock-timeout=500ms sync to fail fast if the database is locked, rather than waiting 30s. Co-Authored-By: Claude Opus 4.5 --- cmd/bd/direct_mode.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/bd/direct_mode.go b/cmd/bd/direct_mode.go index 9f1b3b1a..a6dc56b2 100644 --- a/cmd/bd/direct_mode.go +++ b/cmd/bd/direct_mode.go @@ -89,7 +89,9 @@ func ensureStoreActive() error { } } - sqlStore, err := sqlite.New(getRootContext(), path) + // Use configured lock timeout (default 30s, can be overridden via --lock-timeout) + // This fixes bd-2zd.4: SQLite lock contention during multi-agent operations + sqlStore, err := sqlite.NewWithTimeout(getRootContext(), path, lockTimeout) if err != nil { // Check for fresh clone scenario if isFreshCloneError(err) {