From 8a04cd3382adf0d4e0841573e40924e261bb6bc3 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 2 Nov 2025 15:47:45 -0800 Subject: [PATCH] Fix bd-47f1: bd import now flushes JSONL immediately for daemon visibility - Changed bd import to call flushToJSONL() instead of markDirtyAndScheduleFlush() - Ensures daemon FileWatcher detects changes within ~500ms instead of up to 30s - Fixes race condition where MCP daemon served stale data after CLI import --- cmd/bd/import.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bd/import.go b/cmd/bd/import.go index f2473c67..f5dfbdaf 100644 --- a/cmd/bd/import.go +++ b/cmd/bd/import.go @@ -176,8 +176,9 @@ Behavior: fmt.Fprintf(os.Stderr, "\nAll text and dependency references have been updated.\n") } - // Schedule auto-flush after import completes - markDirtyAndScheduleFlush() + // Flush immediately after import (no debounce) to ensure daemon sees changes + // Without this, daemon FileWatcher won't detect the import for up to 30s + flushToJSONL() // Print summary fmt.Fprintf(os.Stderr, "Import complete: %d created, %d updated", result.Created, result.Updated)