Summary
Semantic recall currently returns no memories when search reports a failure, and thrown search calls bypass recent retrieval. Fall back once to the existing scoped recent-memory listing in relevant and both modes when semantic search returns a failure envelope or throws. If that fallback also fails, recall stays empty and nonfatal.
Successful empty or fully filtered searches remain unchanged, and partial-shard warnings still count as successful searches. Existing scope, session/age eligibility, counts, truthful recent-selection labels, and per-turn caching are preserved. The change adds README documentation and regression coverage for the shared loader, V1 injection, V2 lifecycle, and recovery on the next authored turn. It adds no API, ranking algorithm, or configuration.
Test plan
- Exercised the change locally (or N/A for docs/meta-only)
- Noted any follow-up or known limitations
Validation was completed in an isolated Linux cloud checkout with Bun 1.4.4 and frozen-lockfile dependencies, not on the desktop used to publish this PR:
- 62 focused tests passed.
bun test --timeout 30000: 1,119 passed, 4 skipped, 0 failed across 151 files.
bun run build, bun run typecheck, and bun run check passed.
- The final default 5-second test run had 1,118 passes, 4 skips, and one timeout in the existing profile-tool-runtime missing-email case. The untouched base also showed 5-second timeout sensitivity in that file, but in a different case; all seven base cases passed with a 30-second timeout. No repository timeout settings changed.
Tests use synthetic failures and the native database. Live-provider behavior, Windows/macOS execution, and broader real-world recall quality have not been qualified by this change.
Checklist
- Branch is based on
main (do not open PRs from commits already on main)
-
bun test passes (or N/A)
-
bun run typecheck passes (or N/A)
-
bun run check passes (format + lint + typecheck; or N/A)
- Docs / README updated when behavior or contribution process changes