Bug Report
Summary
memory_search tool call causes an uncaught exception that freezes the agent run and makes the gateway unresponsive. /restart (SIGUSR1) cannot recover — requires manual gateway process restart.
Environment
- OpenClaw version: 2026.2.15
- Node.js: v25.4.0
- OS: macOS (Darwin 23.6.0, arm64)
- Memory provider: local (node-llama-cpp + embeddinggemma-300M)
- Channel: Telegram
Error
[openclaw] Uncaught exception: Error: A FileHandle object was closed during garbage collection.
This used to be allowed with a deprecation warning but is now considered an error.
Please close FileHandle objects explicitly.
File descriptor: 58 (~/.node-llama-cpp/models/hf_ggml-org_embeddinggemma-300m-qat-Q8_0.gguf.ipull)
Steps to Reproduce
- Configure local memory search provider (node-llama-cpp with embeddinggemma-300M)
- Run on Node.js 25.x
- Trigger
memory_search tool call
- The embedding model file handle gets garbage collected instead of being explicitly closed
- Node.js 25 throws a hard error (previously a deprecation warning in earlier Node versions)
Impact
- Agent run freezes mid-tool-call with no response to user
/restart fails — logs show abort failed: reason=no_active_run suggesting the run is in a zombie state
- Requires manual gateway restart (SSH into host, restart process)
- User experienced ~7 minutes of unresponsiveness before manually intervening
Relevant Log Lines
// memory_search tool starts
{"subsystem":"agent/embedded"} embedded run tool start: tool=memory_search
// Embedding batches running
{"subsystem":"memory"} memory embeddings: batch start (items=1, timeoutMs=600000)
{"subsystem":"memory"} memory embeddings: batch start (items=1, timeoutMs=600000)
{"subsystem":"memory"} memory embeddings: batch start (items=1, timeoutMs=600000)
{"subsystem":"memory"} memory embeddings: batch start (items=4, timeoutMs=600000)
// CRASH — FileHandle GC error
[openclaw] Uncaught exception: Error: A FileHandle object was closed during garbage collection...
// Later: /stop and /restart commands fail to abort
{"subsystem":"diagnostic"} abort failed: sessionId=... reason=no_active_run
Expected Behavior
- node-llama-cpp should explicitly close file handles instead of relying on GC
- If a tool call throws an uncaught exception, the gateway should recover gracefully
/restart should be able to kill zombie agent runs
Suggested Fixes
- Immediate: Ensure node-llama-cpp file handles are explicitly closed after embedding operations
- Defensive: Wrap memory_search tool execution in try/catch so uncaught exceptions don't freeze the gateway
- Recovery:
/restart should force-kill any in-progress agent runs regardless of state
Bug Report
Summary
memory_searchtool call causes an uncaught exception that freezes the agent run and makes the gateway unresponsive./restart(SIGUSR1) cannot recover — requires manual gateway process restart.Environment
Error
Steps to Reproduce
memory_searchtool callImpact
/restartfails — logs showabort failed: reason=no_active_runsuggesting the run is in a zombie stateRelevant Log Lines
Expected Behavior
/restartshould be able to kill zombie agent runsSuggested Fixes
/restartshould force-kill any in-progress agent runs regardless of state