openclaw - 💡(How to fix) Fix Memory flush: read tool called with empty path causes crash [1 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#57876Fetched 2026-04-08 01:56:33
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

  1. ENOENT: no such file or directory error
  2. Error propagates, system appears to hang [WARN] read tool called without path: toolCallId=call_function_xxx argsType=object [ERROR] read failed: ENOENT: no such file or directory, access /path/to/memory/2026-03-31.md
RAW_BUFFERClick to expand / collapse

Bug Description

During pre-compaction memory flush, the read tool is called with an empty/null path parameter, causing:

  1. ENOENT: no such file or directory error
  2. Extended blocking (16+ seconds) while the system retries

Steps to Reproduce

  1. Have memory/ directory files missing or empty
  2. System triggers automatic memory compaction/flush
  3. Internal read tool call fires with path: null or path: ""
  4. Error propagates, system appears to hang

Observed Log

``` [WARN] read tool called without path: toolCallId=call_function_xxx argsType=object [ERROR] read failed: ENOENT: no such file or directory, access /path/to/memory/2026-03-31.md ```

Expected Behavior

The read tool should validate required parameters before execution, or the memory flush mechanism should ensure target files exist before calling read.

Environment

  • OpenClaw 2026.3.28
  • Node.js 24.14.0
  • Linux VM

Severity

Medium - causes extended blocking but recovers automatically once file is created.

extent analysis

Fix Plan

To resolve the issue, we need to add input validation to the read tool to handle empty or null path parameters.

  • Update the read tool to check for valid path parameters before execution:
function readTool(path) {
  if (!path || typeof path !== 'string') {
    throw new Error('Invalid path parameter');
  }
  // existing read tool logic
}
  • Alternatively, modify the memory flush mechanism to ensure target files exist before calling the read tool:
function memoryFlush() {
  const filePath = '/path/to/memory/2026-03-31.md';
  if (!fs.existsSync(filePath)) {
    // create file or handle missing file scenario
  }
  readTool(filePath);
}
  • Consider adding retry logic with a limited number of attempts to prevent extended blocking.

Verification

To verify the fix, reproduce the issue by triggering the memory compaction/flush with missing or empty directory files. The system should no longer hang, and the read tool should throw an error or handle the missing file scenario as expected.

Extra Tips

  • Ensure proper error handling and logging mechanisms are in place to catch and report similar issues in the future.
  • Review the OpenClaw and Node.js documentation for best practices on input validation and error handling.

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

openclaw - 💡(How to fix) Fix Memory flush: read tool called with empty path causes crash [1 participants]