Repository navigation
fix(memory): fall back to keyword search when embeddings cannot start - #115397
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 28, 2026 20:29
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞👀 Command router queued. I will update this comment with the next step. |
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞👀 Command router queued. I will update this comment with the next step. |
steipete
force-pushed
the
fix/memory-search-bootstrap-fallback
branch
from
July 29, 2026 00:48
a2fae1e to
0efb3ae
Compare
Contributor
Author
|
ClawSweeper review skipped at operator direction due to publication-queue backlog; autoreview (Codex) clean + exact-head CI green served as the pre-land gates. |
Contributor
Author
|
Merged via squash.
|
vincentkoc
added a commit
that referenced
this pull request
Jul 29, 2026
* origin/main: (57 commits) docs: document gateway and memory chat wizards (#115487) fix(agents): restore subagent completion delivery on CLI runtimes (#115422) fix(sandbox): stop provisioning failures from exhausting fallbacks (#115481) refactor: remove duplicate runtime and plugin paths (#115483) fix(ui): canonicalize agent model identity (#115480) fix(ui): preview model picker interactions live (#115477) fix(ui): match disabled microphone picker background (#115472) refactor(code-mode): split focused runtime stress suites (#115462) fix(gateway): preserve restart intent across coalesced config writes (#110397) fix: scope subagent handoff to direct tools (#115466) docs: explain native subagent handoff fix: clarify native subagent completion handoff fix(config): respect agent directory filesystem case (#105402) refactor(code-mode): unify safe OpenAI tool filtering (#115460) refactor(code-mode): prepare MCP namespaces once per run (#115459) fix(ollama): preserve selected model capabilities during onboarding (#115467) refactor(chat): remove duplicate session projection paths (#115461) refactor(code-mode): make tool catalogs run-owned (#115458) fix(cli): preserve mid-turn text in durable replies (#115455) fix(memory): fall back to keyword search when embeddings cannot start (#115397) ...
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 29, 2026
…openclaw#115397) * fix(memory): degrade bootstrap failures to keyword search * docs(memory): clarify recovery status projection * fix(memory): handle bootstrap embedding failures * fix(memory): trust resolved provider diagnostics * fix(memory): keep degraded syncs keyword-only * fix(memory): confirm embedding recovery before semantic mode * fix(memory): restore semantic readiness after recovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where the first
memory_searchon an empty index returned an ordinary empty result when an optional embedding provider could not start, such as OpenAI auth being absent underprovider: "auto".In production this silent path made provider misconfiguration indistinguishable from a genuine no-match result. Agents could then invent explanations instead of reporting that semantic recall had degraded. The existing request-time keyword fallback did not cover provider construction or the first document-embedding request during search bootstrap, even though the memory-search docs promised keyword-only recall for unset/auto providers without usable embedding auth.
Before, a zero-hit tool result exposed no reason:
{ "results": [], "debug": { "backend": "builtin", "hits": 0 } }After, the same result retains a redacted, actionable degradation reason:
{ "results": [], "debug": { "backend": "builtin", "hits": 0, "embeddingBootstrap": { "ok": false, "provider": "openai", "reason": "MissingProviderAuthError: No API key resolved for provider \"openai\" (auth mode: api-key, checked: OPENAI_API_KEY).", "degradedTo": "keyword-only" } } }Why This Change Was Made
Optional-provider bootstrap failures now reuse the existing FTS-only sync generation and
finalizeKeywordOnlyResultspath. Text and FTS rows are indexed without vectors; required explicit providers remain fail-closed. The existing 30-second embedding availability cache owns retry cadence, ordinary degraded syncs keep the keyword index fresh, and semantic mode resumes only after a successful embedding confirmation and semantic rebuild.The additive public
MemorySearchRuntimeDebug.embeddingBootstrapfield is redacted before reaching tool output. No config, storage schema, protocol version, surface budget, or baseline changed.User Impact
Users with unset/auto/local optional embedding providers retain keyword memory recall when embedding setup or the first bootstrap embedding request fails. Empty keyword results now explain the degradation instead of looking like authoritative proof that memory contains no matches. Explicitly configured remote providers still fail closed.
AI-assisted: implementation and review used Codex; the final full-branch autoreview reported no accepted/actionable findings.
Main-Side CI Follow-up
The temporary per-file timeout mitigation was dropped during current-main replay because #115428 landed the root-cause fix for startup-log shard hangs.
Evidence
node scripts/run-vitest.mjs extensions/memory-core/src/memory/manager.fts-only-reindex.test.ts— 17/17 passed. Covers constructor failure, first embedding-request failure, keyword hits, zero-provider caching, existing semantic indexes, concurrent waiters/retries, degraded watch syncs, semantic recovery, failed recovery, redaction, and required-provider fail-closed behavior.node scripts/run-vitest.mjs extensions/memory-core/src/tools.test.ts— 45/45 passed. Covers zero-hit tool JSON and proves no force-sync retry hidesdebug.embeddingBootstrap.pnpm plugin-sdk:surface:check— passed; 320 entrypoints, 7,508 exports, 0 forbidden package subpaths.pnpm docs:check-mdx— 758 files passed.node scripts/check-changed.mjs -- <8 touched files>— passed on Blacksmith Testbox in https://github.com/openclaw/openclaw/actions/runs/30395124769: all typechecks, changed-file lint, SDK/boundary, dead-export, database-first, schema, and import-cycle guards green..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean; no accepted/actionable findings.