fix(async): from_system_async() now binds to the provided system#6884
fix(async): from_system_async() now binds to the provided system#6884peteroyce wants to merge 1 commit intochroma-core:mainfrom
Conversation
AsyncClient.from_system_async() was calling AsyncClient.create() with system.settings, which creates a fresh client stack and assigns a new UUID identifier — ignoring the actual system object passed in. The sync Client.from_system() calls _populate_data_from_system(system) first, which caches the existing system so subsequent create() calls reuse it. Adding the same call to from_system_async() aligns the async implementation with its sync counterpart. Closes chroma-core#6871
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
|
Fix This PR fixes a behavior bug in The change restores the documented contract of creating a client from an existing system and aligns async and sync semantics, preventing unintended creation of a different underlying system identity when a caller explicitly provides one. This summary was automatically generated by @propel-code-bot |
Summary
AsyncClient.from_system_async(system, ...)was ignoring thesystemargument and creating a fresh client stack fromsystem.settings. This violated the documented contract ("create a client from an existing system") and was inconsistent with the syncClient.from_system().Root Cause
The sync
from_system()callsSharedSystemClient._populate_data_from_system(system)before constructing the client, which caches the existingSystemobject. Subsequentcreate()calls then find and reuse that cached system via its identifier.The async version skipped this step, so
AsyncClient.create()always spun up a brand new system, giving the client a different UUID than the one passed in.Changes
chromadb/api/async_client.py: addSharedSystemClient._populate_data_from_system(system)call beforeAsyncClient.create(), mirroring the syncClient.from_system()implementationCloses #6871