Repository navigation
fix: room list namespace filter + room recall query empty results (#545, #546) - #558
Merged
Merged
Conversation
…, #546) #545: list_rooms used unnecessary JOIN room_memories to filter by namespace. The namespace column lives directly on the rooms table — a simple WHERE clause suffices. The JOIN could return wrong results when rooms have no memories linked yet. #546: room_recall_query capped fetch_limit with id_set.len(), causing empty results for rooms with fewer linked memory IDs than the expected fetch batch. Also capped to min(fetch_limit, id_set.len()) which meant rooms with 0-1 memories always got 0 results from vector search.
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (1)
Review powered by cora-cli · BYOK · MIT |
This was referenced Jul 4, 2026
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.
Closes
#545 — Root Cause
list_rooms()usedINNER JOIN room_memoriesto filter by namespace. The namespace column lives directly on theroomstable — no JOIN needed. The JOIN returned empty results when a room had no linked memories yet, causing the filter to miss valid rooms.Fix: Replaced JOIN query with simple
SELECT ... FROM rooms WHERE namespace = ?1.#546 — Root Cause
room_recall_query()cappedfetch_limittomin(fetch_limit, id_set.len()). When a room had fewer linked memory IDs than the fetch batch size, the limit was reduced — meaning rooms with 0-1 linked IDs got 0 results from vector search. The chronological path worked because it doesn't depend on vector recall.Fix: Removed the
fetch_limit.min(id_set.len())cap. Fetch limit is now(limit * 5).min(200).max(limit)as originally intended.