Repository navigation
fix(store): stop unsorted lookups after the first namespace match - #747
Merged
earakely-scale merged 2 commits intoNov 20, 2026
Merged
earakely-scale merged 2 commits into
earakely-scale merged 2 commits into
Conversation
morningducke
marked this pull request as ready for review
November 17, 2026 21:11
earakely-scale
approved these changes
Nov 20, 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.
What and why
An unsorted routed lookup already selects the first matching namespace, but it eagerly queries every backend before returning. Appending a local conversation turn can therefore scan an unrelated, unindexed shared conversation table and block before the first solver request.
Return immediately on the first match when no sort keys are specified. Preserve namespace precedence, fallback after a miss, and cross-store merging for sorted lookups. Regression tests cover local, Hub and configured-store precedence, empty sorts, misses, sorted results, and the real conversation append path.
How it was tested
git diff --checkpass.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Unsorted routed lookups now stop at the first matching store, avoiding needless reads without changing which document wins.
No actionable issues found.
Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/short-circu..." · Reviewed by Greptile