fix(vector-db): pass unique storagePath to VectorDB to prevent daemon lock conflict#2230
Open
ruvnet wants to merge 2 commits into
Open
fix(vector-db): pass unique storagePath to VectorDB to prevent daemon lock conflict#2230ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
… lock conflict
Without a storagePath the native VectorDB opened the default "agentdb.rvf"
in CWD, which running claude-flow daemons already hold exclusively. The
constructor threw "Database already open. Cannot acquire lock", the silent
catch {} degraded the adapter to FallbackVectorDB, and every benchmark
measured brute-force-vs-brute-force instead of HNSW.
Fix: generate a per-call temp file path (os.tmpdir/ruvector-<pid>-<rand>.rvf)
so the adapter never races the daemon's lock. Also surface any remaining
HNSW init failures as console.warn instead of swallowing them silently.
Co-Authored-By: claude-flow <ruv@ruv.net>
Bumps @claude-flow/cli and claude-flow to 3.7.0-alpha.82 to ship the HNSW storage-path fix (vector-db.ts: pass unique tmpdir path to VectorDB constructor so it no longer races the daemon lock on agentdb.rvf). Co-Authored-By: claude-flow <ruv@ruv.net>
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.
Summary
FallbackVectorDBon every startupnew VectorDBClass({ dimensions })— nostoragePath— so the native binding defaulted toagentdb.rvfin CWD, which running daemons hold exclusively"Database already open. Cannot acquire lock", the silentcatch {}swallowed the error, and every search ran O(n) brute-force instead of HNSW~1.0× speedupandrecall@10 = 1.0at every N were the signature of brute-force vs brute-forceFix (
v3/@claude-flow/cli/src/ruvector/vector-db.ts)uniqueStoragePath()— generatesos.tmpdir()/ruvector-<pid>-<rand>.rvfso each adapter instance owns its own file and never contends with the daemon locknew VectorDBClass({ dimensions })→new VectorDBClass({ dimensions, storagePath: uniqueStoragePath() })catch {}emitconsole.warnso any future HNSW init failure is visiblePublished
@claude-flow/cli@3.7.0-alpha.82andclaude-flow@3.7.0-alpha.82shipped to npm with this fix.Test plan
npx @claude-flow/cli@latest— HNSW activates (no[vector-db] HNSW init failedwarning)🤖 Generated with claude-flow