Repository navigation
Conversation
…imit MemoryFileStore.search_transcripts appended a match and only then checked whether it had reached the limit, so limit=0 (and any negative limit) returned exactly one result instead of none. The limit is passed through unchanged by the search_memory_transcripts tool, so a model supplying 0 silently got a single row. Short-circuit before scanning when limit <= 0. Adds a regression test covering limit=0 and a negative limit.
lisry-1
requested review from
SergeyMenshykh,
Eduard van Valkenburg (eavanvalkenburg),
Roger Barreto (rogerbarreto) and
westey (westey-m)
as code owners
October 31, 2026 06:35
lisry-1
temporarily deployed
to
github-app-auth
October 31, 2026 06:35 — with
GitHub Actions
Inactive
lisry-1
requested review from
Darren Cohen (dargilco),
Jose Alvarez (jpalvarezl) and
sophia-ramsey
as code owners
October 31, 2026 06:35
lisry-1
temporarily deployed
to
github-app-auth
October 31, 2026 06:36 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the fix to non-positive transcript-search limits.
No open issues 🎉
What changed in this PR
Fixes transcript search in Python’s MemoryFileStore so non-positive limits return no results instead of one match.
Changes:
- Returns an empty list before scanning transcripts when
limit <= 0, while preserving empty-query validation. - Adds regression coverage for zero and negative limits.
| File | Description |
|---|---|
python/packages/core/tests/core/test_harness_memory.py |
Adds regression assertions for limits of 0 and -1. |
python/packages/core/agent_framework/_harness/_memory.py |
Adds an early return for non-positive search limits. |
Review effort: Balanced
This branch was previously deployed
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.
Summary
MemoryFileStore.search_transcriptsappended a match and only then checked whether it had reachedlimit, solimit=0(and any negative limit) returned exactly one result instead of none. Thesearch_memory_transcriptstool passeslimitthrough unchanged, so a model supplying0silently received a single row — inconsistent with the pagination convention elsewhere (_validate_pagingrejectstop <= 0).Changes
limit <= 0, returning an empty list.ValueError).Tests
Adds
test_search_transcripts_non_positive_limit_returns_nothingcoveringlimit=0and a negative limit.