fix(system-health): detect modern sql.js memory DB paths#1643
Open
IRakow wants to merge 1 commit intoruvnet:mainfrom
Open
fix(system-health): detect modern sql.js memory DB paths#1643IRakow wants to merge 1 commit intoruvnet:mainfrom
IRakow wants to merge 1 commit intoruvnet:mainfrom
Conversation
system_health reports memory as 'degraded' with "Memory store not found — run memory init" on every healthy sql.js install, because the check only looks for the legacy JSON-backend path .claude-flow/memory/store.json. The sql.js backend (current default per memory-initializer.js) persists to .swarm/memory.db, so the legacy JSON path never exists and the check always returns degraded — even when memory_stats reports initialized:true and memory is clearly functional. Check modern sql.js locations first (.swarm/memory.db, .claude-flow/memory.db, data/memory.db), with the legacy store.json retained as a fallback for backwards compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
system_healthreports memory asdegradedwith"Memory store not found — run memory init"on every healthy sql.js install.Reproduction against v3.5.80:
Cause
v3/@claude-flow/cli/src/mcp-tools/system-tools.tsat line 312 checks only the legacy JSON-backend path:The modern sql.js backend — the default on current installs, per
@claude-flow/cli/.../memory-initializer.js:366— persists to.swarm/memory.db. The legacy JSON path never exists on these installs, so the check always reports degraded.Same file already looks at the sql.js paths elsewhere (
statusline-generator.jslines 231-233, 501-503) using exactly.swarm/memory.db,.claude-flow/memory.db,data/memory.db— aligningsystem_healthwith that convention.Fix
Check the modern sql.js paths first, fall back to the legacy JSON path for backwards compatibility. Five-line change, no behavior change when either path exists — only fixes the false-positive degraded status.
Verified
Applied same patch to the built
system-tools.jslocally on v3.5.80;system_healthflips memory fromdegraded→healthywhen.swarm/memory.dbexists (the expected state aftermemory init), and continues to report degraded when no store exists at all.Notes
memory_stats,memory_store,memory_searchall work correctly; only the health reporting was wrong.