openclaw - 💡(How to fix) Fix v2026.3.28: memory-lancedb fails to load (missing dist/package.json + @lancedb/lancedb) and recall broken with embedding context length error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56780Fetched 2026-04-08 01:47:51
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

Error Message

Error: ENOENT: no such file or directory, open '/opt/homebrew/lib/node_modules/openclaw/dist/package.json'

Root Cause

Root cause: lancedb-runtime-*.js reads ./package.json (relative to its location in dist/) to find the @lancedb/lancedb dependency spec. But dist/package.json does not exist in the 2026.3.28 npm install — only the root package.json does.

Fix Action

Fix / Workaround

Workaround that fixed it:

  1. Copied root package.json to dist/package.json
  2. Added "@lancedb/lancedb": "^0.27.1" to its dependencies
  3. Also ran npm install in dist/extensions/memory-lancedb/ to install the dep there

Both issues together mean memory recall is non-functional after upgrading to 2026.3.28. The startup ENOENT blocks loading entirely, and even after the workaround, recall fails on every turn.

Code Example

Error: ENOENT: no such file or directory, open '/opt/homebrew/lib/node_modules/openclaw/dist/package.json'

---

memory-lancedb: recall failed: Error: 400 the input length exceeds the context length

---

{
  "memory-lancedb": {
    "enabled": true,
    "config": {
      "embedding": {
        "apiKey": "ollama",
        "baseUrl": "http://localhost:11434/v1",
        "model": "mxbai-embed-large",
        "dimensions": 1024
      },
      "autoCapture": false,
      "autoRecall": true,
      "captureMaxChars": 400
    }
  }
}
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.3.28 (upgraded from 2026.3.24)
  • Platform: macOS 26.4 arm64 (Apple Silicon Mac mini)
  • Embedding model: mxbai-embed-large via Ollama

Issues

1. memory-lancedb fails to load on startup

After upgrading to 2026.3.28, memory-lancedb fails to load with:

Error: ENOENT: no such file or directory, open '/opt/homebrew/lib/node_modules/openclaw/dist/package.json'

Root cause: lancedb-runtime-*.js reads ./package.json (relative to its location in dist/) to find the @lancedb/lancedb dependency spec. But dist/package.json does not exist in the 2026.3.28 npm install — only the root package.json does.

Workaround that fixed it:

  1. Copied root package.json to dist/package.json
  2. Added "@lancedb/lancedb": "^0.27.1" to its dependencies
  3. Also ran npm install in dist/extensions/memory-lancedb/ to install the dep there

Then gateway restart loaded memory-lancedb successfully.

2. memory-lancedb recall fails with context length error

After the load issue was fixed, recall fails on every inbound message:

memory-lancedb: recall failed: Error: 400 the input length exceeds the context length

The recall query (built from the inbound message including Discord metadata) exceeds the embedding model's context window (512 tokens for mxbai-embed-large). The captureMaxChars: 400 config option truncates stored text but does not appear to truncate the recall query.

This worked correctly on 2026.3.24. Something in the recall path changed in 2026.3.28.

Config:

{
  "memory-lancedb": {
    "enabled": true,
    "config": {
      "embedding": {
        "apiKey": "ollama",
        "baseUrl": "http://localhost:11434/v1",
        "model": "mxbai-embed-large",
        "dimensions": 1024
      },
      "autoCapture": false,
      "autoRecall": true,
      "captureMaxChars": 400
    }
  }
}

Impact

Both issues together mean memory recall is non-functional after upgrading to 2026.3.28. The startup ENOENT blocks loading entirely, and even after the workaround, recall fails on every turn.

extent analysis

Fix Plan

To resolve the issues, follow these steps:

Fix 1: memory-lancedb fails to load on startup

  1. Copy the root package.json to dist/package.json.
  2. Add "@lancedb/lancedb": "^0.27.1" to the dependencies in dist/package.json.
  3. Run npm install in dist/extensions/memory-lancedb/ to install the dependency.

Fix 2: memory-lancedb recall fails with context length error

  1. Update the captureMaxChars config option to truncate the recall query.
  2. Modify the recall query builder to truncate the input text to the embedding model's context window (512 tokens).

Example code to truncate the recall query:

const maxContextLength = 512;
const recallQuery = inboundMessage.text.substring(0, maxContextLength);

Alternatively, update the memory-lancedb config to include a recallMaxChars option:

{
  "memory-lancedb": {
    "enabled": true,
    "config": {
      "embedding": {
        "apiKey": "ollama",
        "baseUrl": "http://localhost:11434/v1",
        "model": "mxbai-embed-large",
        "dimensions": 1024
      },
      "autoCapture": false,
      "autoRecall": true,
      "captureMaxChars": 400,
      "recallMaxChars": 512
    }
  }
}

Then, update the recall query builder to use the recallMaxChars config option:

const recallMaxChars = config.recallMaxChars;
const recallQuery = inboundMessage.text.substring(0, recallMaxChars);

Verification

  1. Restart the gateway after applying the fixes.
  2. Verify that memory-lancedb loads successfully.
  3. Test recall functionality with inbound messages to ensure it works correctly.

Extra Tips

  • Monitor the memory-lancedb logs for any errors or issues after applying the fixes.
  • Consider updating the memory-lancedb config to use a more robust truncation strategy, such as truncating to the nearest sentence or paragraph boundary.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING