Skip to content

fix(system-health): detect modern sql.js memory DB paths#1643

Open
IRakow wants to merge 1 commit intoruvnet:mainfrom
IRakow:fix/system-health-memory-check
Open

fix(system-health): detect modern sql.js memory DB paths#1643
IRakow wants to merge 1 commit intoruvnet:mainfrom
IRakow:fix/system-health-memory-check

Conversation

@IRakow
Copy link
Copy Markdown

@IRakow IRakow commented Apr 24, 2026

Problem

system_health reports memory as degraded with "Memory store not found — run memory init" on every healthy sql.js install.

Reproduction against v3.5.80:

$ ruflo memory init
$ ruflo memory stats
  initialized: true, backend: sql.js + HNSW, ...
$ (call mcp__ruflo__system_health)
  memory: degraded — "Memory store not found — run memory init"

Cause

v3/@claude-flow/cli/src/mcp-tools/system-tools.ts at line 312 checks only the legacy JSON-backend path:

const memoryDbPath = join(projectCwd, '.claude-flow', 'memory', 'store.json');

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.js lines 231-233, 501-503) using exactly .swarm/memory.db, .claude-flow/memory.db, data/memory.db — aligning system_health with 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.js locally on v3.5.80; system_health flips memory from degradedhealthy when .swarm/memory.db exists (the expected state after memory init), and continues to report degraded when no store exists at all.

Notes

  • Every Ruflo user on a sql.js install sees this — it's not install-specific.
  • Non-functional: memory_stats, memory_store, memory_search all work correctly; only the health reporting was wrong.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant