Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
On OpenClaw 2026.7.1, in-gateway memory_search intermittently returned disabled/unavailable with database is not open while the same builtin SQLite index passed PRAGMA quick_check, deep status reported a valid/ready index, and a non-force incremental index restored search without a Gateway restart.
Steps to reproduce
NOT_ENOUGH_INFO
Expected behavior
memory_search should query the healthy builtin index without returning disabled/unavailable. After a non-force incremental index, the same tool and CLI search path returned results against the same database without a Gateway restart.
Actual behavior
A memory_search call returned:
{
"results": [],
"disabled": true,
"unavailable": true,
"error": "database is not open",
"warning": "Memory search is unavailable due to an embedding/provider error.",
"action": "Check embedding provider configuration and retry memory_search."
}Immediate inspection found no SQLite corruption or unavailable search component. A non-force openclaw memory index --agent main restored both tool-side and CLI search.
OpenClaw version
2026.7.1 (2d2ddc4)
Operating system
Linux 7.0.11-orbstack-00360-gc9bc4d96ac70 (arm64)
Install method
npm global package (/usr/lib/node_modules/openclaw)
Model
Agent: openai/gpt-5.6-sol; memory embeddings: openai/text-embedding-3-small
Provider / routing chain
OpenClaw builtin memory-core -> OpenAI embeddings (text-embedding-3-small)
Additional provider/model setup details
Builtin memory backend with memory and sessions sources plus workspace docs as an extra path. The OpenAI embedding probe passed during openclaw memory status --deep --index --json immediately after the failure.
Logs
# Failed in-gateway tool call
error: database is not open
disabled: true
unavailable: true
# State inspected immediately afterward
OpenClaw: 2026.7.1 (2d2ddc4)
SQLite size: approximately 1.1 GB
PRAGMA quick_check: ok
PRAGMA journal_mode: wal
WAL checkpoint: 0|0|0
Index at failure: 1932/1933 files
Deep status: index identity valid; embedding probe ok; FTS ready;
sqlite-vec store available; semantic search available
# Non-force recovery
openclaw memory index --agent main
Memory index updated (main).
# State after recovery
Indexed: 1933/1933 files
Chunks: 12010
CLI search: successful
Three subsequent in-gateway memory_search calls: successful
Gateway restart: not performed
Full/force rebuild: not performedScreenshots, recordings, and evidence
The source Markdown files remained intact. The same approximately 1.1 GB SQLite file passed quick_check; no database replacement, full rebuild, or Gateway restart was needed. Search recovered after the non-force incremental index.
Impact and severity
Affected: builtin memory-core recall in the main agent.
Severity: medium; the failed call blocks semantic/keyword recall until a manual incremental index is run.
Frequency: intermittent. A deterministic trigger was not identified.
Consequence: recall-dependent workflows fail for the affected call. No corruption or data loss was observed.
Additional information
This is a fresh latest-release occurrence of the closed-handle symptom family previously reported in #18083 and #77781. It is not the sqlite-vec-unavailable variant from #77781: deep status reported sqlite-vec store and semantic search available. #18083 was closed with a request to open a new issue if the symptom still occurs on the latest release.
Last known good version / first known bad version: NOT_ENOUGH_INFO
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 16, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Close as implemented on current
main. The memory-core tool now recognizes the reported closed SQLite-handle error, reacquires the memory manager, and retries the same search; focused regression coverage uses the exactdatabase is not opensymptom and verifies a successful second search. The fix is newer thanv2026.7.1, so affected operators need the next release containing current main.So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the current one-shot closed-handle recovery on main and include it in the next release so released installations no longer need an incremental index command to recover this symptom.
Do we have a high-confidence way to reproduce the issue?
No current-main failure reproduction was established because the checked-in tool path now catches the exact closed-handle message and retries. The release report plus exact focused regression coverage provide high-confidence source evidence for the former behavior and its recovery.
Is this the best way to solve the issue?
Yes. Retrying once at the memory tool boundary after reacquiring the manager is the narrowest maintainable fix: it preserves the healthy index and avoids requiring a gateway restart or operator-run index command.
Security review:
Security review: No pull-request patch is under review; the issue reports availability of local memory search rather than a security boundary concern.
AGENTS.md: found and applied where relevant.
What I checked:
database is not open, reacquires the manager context, and repeats the original search rather than returning the unavailable result. (extensions/memory-core/src/tools.ts:687, 642ded397bc1)database is not open; it expects a result after two searches and two manager acquisitions, matching the reported healthy-index recovery case. (extensions/memory-core/src/tools.test.ts:750, 642ded397bc1)extensions/memory-core/src/memory/manager.ts:605, 642ded397bc1)git blameattributes the closed-store retry lines to commit642ded397bc1b8ffb89543728c79d109b7c8cdc6;git log -S'isClosedMemoryStoreError'identifies the same commit as the introduction point. (extensions/memory-core/src/tools.ts:690, 642ded397bc1)main, whilegit tag --contains 642ded397bc1b8ffb89543728c79d109b7c8cdc6returned no release tag and thev2026.7.1ancestry check was negative. It is therefore fixed on main but not proven shipped inv2026.7.1. (extensions/memory-core/src/tools.ts:687, 642ded397bc1)session-memory, which is M3 Beta and therefore not eligible formaturity:stable. (qa/maturity-scores.yaml, 642ded397bc1)Likely related people:
extensions/memory-core/src/tools.ts,extensions/memory-core/src/tools.test.ts)extensions/memory-core/src/tools.ts,extensions/memory-core/src/memory/manager.ts,extensions/memory-core/src/memory/search-manager.ts)Codex review notes: model internal, reasoning high; reviewed against 4a8ce9c3365b; fix evidence: commit 642ded397bc1, main fix timestamp 2026-07-31T22:28:20+08:00.
steipete commentedon Aug 3, 2026
Fixed after the affected v2026.7.1 release by #113471. The search retry already existed in v2026.7.1, but its cache could hand that retry the same closing or closed SQLite-backed memory manager. The shared manager owner now retires closing/closed cache entries, serializes teardown with reacquisition, and creates a fresh manager. Regressions cover both the concurrent close/reacquire race and the exact
database is not openretry. Available in v2026.7.2-beta.6 and later.