{{ message }}
Repository navigation
Conversation
Contributor
Coverage report (chroma)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
Contributor
|
Hi @CHX606, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
HaystackBot
marked this pull request as draft
October 18, 2026 04:31
CHX606
marked this pull request as ready for review
October 19, 2026 13:01
Contributor
This branch has not been 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.

Proposed Changes
Chroma metadata can contain an id key independently of Document.id. A top-level filter on meta.id currently loses its namespace during conversion and is then sent as Chroma's document IDs parameter
This can return the wrong document. Given document-a with meta.id="target", and a different document whose Document.id is "target" but meta.id="other", filtering meta.id == "target" currently returns the second document. Wrapping that same metadata condition in AND happens to return the first document
Only the original, unprefixed id field now uses the IDs parameter. meta.id remains a metadata comparison, so equality, inequality and membership retain their metadata semantics. Existing validation is extracted into a small helper without changing it
Reproduction
Before, this prints ["target"]. After, it prints ["document-a"]. Filtering the unprefixed id == "target" still returns ["target"]
This uses a real in-memory Chroma collection and supplied embeddings, with no model download, API key or mocked document-store result
How did you test it?
The 13 added regressions give 9 failures and 4 passes on the base, then all pass with the fix. They cover metadata equality, inequality, in/not in, empty-string metadata, no match, a logical AND, and a separate Document.id control
Two additional boundary cases exercise real Chroma validation for a scalar membership value and a non-string content value. They verify the integration's filter exception, metadata/content category, and original ValueError cause without mocking the validator or matching Chroma's full error message
The HTTP-server asynchronous integration suite was not run locally. No dependencies, public parameters, version files or generated changelogs were changed
Notes for the reviewer
AI tooling generated the implementation and regression tests. The patch was checked independently against the original conversion logic and the real Chroma results above. No personal human review is claimed
Checklist