← Back to PRs

#23808: fix: skip builtin fallback when memorySearch.fallback='none'

by siddhantjain open 2026-02-22 18:15 View on GitHub →
size: S
## Summary When `memory.backend='qmd'` is configured, the search-manager always attempted to fall back to `MemoryIndexManager` if QMD failed. This caused API key errors (OpenAI/Google) even when the user explicitly set `memorySearch.fallback='none'` to disable fallback. ## Root Cause `getMemorySearchManager()` ignored the fallback config setting and unconditionally tried `MemoryIndexManager.get()`. ## Changes - Add `isMemorySearchFallbackDisabled()` to check if fallback is explicitly set to `'none'` (not just unset/undefined) - Skip `MemoryIndexManager` initialization when fallback is disabled - Update `FallbackMemoryManager` to respect `fallbackDisabled` flag for runtime QMD failures - Return descriptive error when QMD unavailable and fallback disabled ## Backward Compatibility Maintains backward compatibility: when fallback is not explicitly set, existing behavior (try builtin) is preserved. ## Testing ```bash pnpm test src/memory/ # 193 tests pass pnpm test src/agents/tools/memory-tool # 10 tests pass ``` ## Config Example ```json { "memory": { "backend": "qmd" }, "agents": { "defaults": { "memorySearch": { "fallback": "none" } } } } ```

Most Similar PRs