fix(nodb): set cmdCtx.StoreActive in initializeNoDbMode (GH#897)

The bug: initializeNoDbMode() was setting the legacy global storeActive
but not cmdCtx.StoreActive. When ensureStoreActive() checked
isStoreActive(), it used cmdCtx.StoreActive (which was false), causing
the JSONL-only mode error even when --no-db was passed.

The fix: Use accessor functions (lockStore, setStore, setStoreActive,
unlockStore) which set both the legacy globals and cmdCtx fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/grip
2026-01-04 16:24:05 -08:00
committed by Steve Yegge
parent 659f52d6bd
commit 85ac1e126b
2 changed files with 70 additions and 4 deletions

View File

@@ -73,10 +73,11 @@ func initializeNoDbMode() error {
debug.Logf("using prefix '%s'", prefix)
// Set global store and mark as active (fixes bd comment --no-db)
storeMutex.Lock()
store = memStore
storeActive = true
storeMutex.Unlock()
// GH#897: Use accessor functions to also set cmdCtx fields, not just globals
lockStore()
setStore(memStore)
setStoreActive(true)
unlockStore()
return nil
}