Skip to content

fix: room list namespace filter + room recall query empty results (#545, #546) - #558

Merged
ajianaz merged 1 commit into
developfrom
fix/issue-545-546-room-list-recall-bugs
Jul 4, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/issue-545-546-room-list-recall-bugs

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes

#545 — Root Cause

list_rooms() used INNER JOIN room_memories to filter by namespace. The namespace column lives directly on the rooms table — 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() capped fetch_limit to min(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.

…, #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.
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (1)

  • crates/uteke-core/src/rooms.rs:95 — The change removes let fetch_limit = fetch_limit.min(id_set.len()); before calling self.recall_hybrid(...). This means a room with only a small number of linked memories can still trigger a hybrid recall for up to (limit * 5).min(200).max(limit) candidates across the whole corpus. Because the later filtering uses id_set, this does not improve result quality for that room, but it does expand the search unnecessarily and can change behavior when unrelated high-scoring memories crowd out room-linked candidates before filtering.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit b3ec8a8 into develop Jul 4, 2026
9 checks passed
@ajianaz
ajianaz deleted the fix/issue-545-546-room-list-recall-bugs branch July 9, 2026 14:27
ajianaz added a commit that referenced this pull request Aug 13, 2026
…recall-bugs

fix: room list namespace filter + room recall query empty results (#545, #546)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant