v2/docs/AGENTIC_FLOW_ENABLED_LOG_FIX.md
When using npx claude-flow@alpha memory store, the log shows:
[ReasoningBank] Enabled: false
Even though ReasoningBank is working correctly. This is misleading to users.
File: agentic-flow/src/reasoningbank/index.ts (or .js)
Line: ~41
console.log(`[ReasoningBank] Enabled: ${!!process.env.REASONINGBANK_ENABLED}`);
This checks for an environment variable that is never set, so it always shows false.
Change line 41 from:
console.log(`[ReasoningBank] Enabled: ${!!process.env.REASONINGBANK_ENABLED}`);
To:
console.log('[ReasoningBank] Enabled: true (initializing...)');
cd /path/to/agentic-flow
git checkout updates-oct-25 # Or your working branch
File: src/reasoningbank/index.ts (or src/reasoningbank/index.js)
Find line 41 (approximately):
export async function initialize() {
const config = loadConfig();
console.log('[ReasoningBank] Initializing...');
console.log(`[ReasoningBank] Enabled: ${!!process.env.REASONINGBANK_ENABLED}`); // ← FIX THIS LINE
console.log(`[ReasoningBank] Database: ${process.env.CLAUDE_FLOW_DB_PATH || '.swarm/memory.db'}`);
// ... rest of function
}
Replace with:
export async function initialize() {
const config = loadConfig();
console.log('[ReasoningBank] Initializing...');
console.log('[ReasoningBank] Enabled: true (initializing...)'); // ← FIXED!
console.log(`[ReasoningBank] Database: ${process.env.CLAUDE_FLOW_DB_PATH || '.swarm/memory.db'}`);
// ... rest of function
}
# If using TypeScript
npm run build
# Or if building with swc
npm run build:esm
Check that dist/reasoningbank/index.js line 41 now shows:
console.log('[ReasoningBank] Enabled: true (initializing...)');
Edit package.json:
{
"version": "1.8.5"
}
git add .
git commit -m "fix: Show accurate 'Enabled: true' during ReasoningBank initialization
- Changed misleading env variable check to hardcoded true
- Users were confused by 'Enabled: false' when ReasoningBank was working
- Affects npx users who see this message during initialization"
git push origin updates-oct-25
# Publish to npm
npm publish
[ReasoningBank] Initializing...
[ReasoningBank] Enabled: false ← MISLEADING!
[ReasoningBank] Database: .swarm/memory.db
[ReasoningBank] Initializing...
[ReasoningBank] Enabled: true (initializing...) ← ACCURATE!
[ReasoningBank] Database: .swarm/memory.db
Once [email protected] is published, update claude-flow:
cd /workspaces/claude-code-flow
npm install [email protected] --legacy-peer-deps
Already set to use ^1.8.4, which will automatically pick up 1.8.5:
{
"dependencies": {
"agentic-flow": "^1.8.4" // Will match 1.8.5
}
}
The postinstall patch is no longer needed. Edit package.json:
Before:
{
"postinstall": "node scripts/install-arm64.js || true && bash scripts/fix-agentdb-imports.sh || true && bash scripts/fix-agentic-flow-sqlite.sh || true && bash scripts/fix-agentic-flow-enabled-log.sh || true"
}
After:
{
"postinstall": "node scripts/install-arm64.js || true && bash scripts/fix-agentdb-imports.sh || true"
}
# Update version
npm version patch # Changes to 2.7.23
# Build
npm run build:esm
# Commit
git add .
git commit -m "chore: v2.7.23 - Use [email protected] with fixed log message"
# Publish
npm publish --tag alpha
npx claude-flow@alpha memory store "test" "value"
Expected output:
[ReasoningBank] Initializing...
[ReasoningBank] Enabled: true (initializing...) ✅
[ReasoningBank] Database: .swarm/memory.db
[INFO] Database migrations completed
✅ Stored successfully in ReasoningBank
The issue: Postinstall hooks don't run when using npx because:
The solution: Fix must be in the source code of agentic-flow, not a runtime patch.
const BetterSqlite3 = null; bugSummary: The "Enabled: false" message needs to be fixed in agentic-flow's source code and published as v1.8.5, just like the better-sqlite3 fix was published in v1.8.4.