Fixing some retriever bugs and adding more test coverage - #539
Merged
Aayush Kataria (aayush3011) merged 4 commits intoApr 26, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Aayush Kataria (aayush3011)
April 26, 2026 17:56
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses retriever behavior and checkpoint listing/pending-write retrieval in the Azure CosmosDB LangChain/LangGraph integrations, and adds unit/integration coverage to prevent regressions.
Changes:
- Added retriever-focused unit tests (including async
ainvoke) and an async integration test for retriever usage. - Updated LangGraph checkpoint store (sync + async) to push
before, ordering, and (in some cases)TOPlimiting into Cosmos SQL queries instead of sorting/filtering purely in Python. - Added
_aget_relevant_documentsimplementation for the sync vectorstore retriever.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/azure-cosmosdb/tests/unit_tests/test_vectorstore.py | Adds unit tests covering retriever invoke/ainvoke and search type validation. |
| libs/azure-cosmosdb/tests/unit_tests/test_langgraph_checkpoint_keys.py | Adds unit tests asserting query construction details (ORDER BY/TOP/before) for checkpoint listing. |
| libs/azure-cosmosdb/tests/integration_tests/aio/test_vectorstore.py | Adds async integration coverage for retriever ainvoke. |
| libs/azure-cosmosdb/src/langchain_azure_cosmosdb/aio/_langgraph_checkpoint_store.py | Pushes list ordering/before/limit into Cosmos queries; changes pending writes ordering approach. |
| libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_langgraph_checkpoint_store.py | Same as async version for sync saver; changes pending writes ordering approach. |
| libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_vectorstore.py | Adds _aget_relevant_documents to the sync retriever and imports async callback manager type. |
Copilot started reviewing on behalf of
Aayush Kataria (aayush3011)
April 26, 2026 18:11
View session
Copilot started reviewing on behalf of
Aayush Kataria (aayush3011)
April 26, 2026 18:19
View session
Copilot started reviewing on behalf of
Aayush Kataria (aayush3011)
April 26, 2026 18:30
View session
Aayush Kataria (aayush3011)
marked this pull request as ready for review
April 26, 2026 21:32
Aayush Kataria (aayush3011)
merged commit Apr 26, 2026
cea67f1
into
langchain-ai:main
12 checks passed
This was referenced Apr 26, 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.
No description provided.