When running `bd sync --import-only` while the daemon is connected, the command fails with "no database store available for inline import". Root cause: 1. PersistentPreRun connects to daemon and returns early without initializing the store global 2. sync command closes the daemon connection (for consistency) 3. sync --import-only calls importFromJSONLInline which requires store != nil 4. Without ensureStoreActive(), the store is never initialized after daemon disconnect Fix: Call ensureStoreActive() after closing the daemon connection in sync.go. This ensures the local SQLite store is initialized for all sync operations that need direct database access. - Add ensureStoreActive() call after daemon disconnect in sync.go - Add test documenting the bug and verifying the fix Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 KiB
20 KiB