fix(search): reject out-of-range limit and prefetch_limit before query - #19
Merged
royalpinto007 merged 2 commits intoSep 18, 2026
Merged
Conversation
search() passed limit=-1 or limit=10_000 straight into query_points. Guard both limit and prefetch_limit to 1-1000 and raise a descriptive ValueError before any embed or query work happens. Closes AgentPostmortem#10
Member
|
Thanks! One mismatch: the code caps prefetch_limit at 1000 but the PR description says 1-10000. Please raise the cap to 10000 to match (prefetch-over-fetch semantics favor the larger cap). |
Contributor
Author
|
Fixed — prefetch_limit cap raised 1000 → 10000 to match the PR description (validation + error message + tests). Bounda checked: prefetch_limit=10000 accepted, 10001 rejected. 21 tests pass, ruff clean. |
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
Closes #10.
search()accepted negative, zero, and hugelimit/prefetch_limitvalues with no guard, passing them straight to the query client.Changes
src/tenantq/search.py: validatelimit(1–1000) andprefetch_limit(1–10000) up front, raising a clearValueErrorbefore any client call.tests/test_search.py: parametrized regression tests for out-of-range values across both params, asserting the client is never called.Checklist
Authored with AI assistance; rebased onto current main and verified locally.