chroma-core / chroma-core/chroma
[Bug]: `from_system_async()` builds a fresh client system instead of reusing the provided one
- Dominant language
- Rust
- Stars
- 29.3k
- Forks
- 2.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 38
Description
## What happened?
`AsyncClient.from_system_async(system, ...)` is documented as creating a client from an existing system for testing/debugging, but its implementation **ignores the `system` object** and simply calls `AsyncClient.create(..., system.settings)`.
That recreates the client stack from settings instead of binding to the supplied component graph. `SharedSystemClient` assigns a fresh UUID identifier per creation, so the new async client is guaranteed to live on a different cached system than the caller passed in.
### Root Cause
```python
# chromadb/api/async_client.py
@classmethod
async def from_system_async(cls, system: System, ...) -> "AsyncClient":
"""Create a client from an existing system. Useful for testing and debugging."""
return await AsyncClient.create(tenant, database, system.settings)
# ↑ ignores `system`, creates a new one from settings
```
Compare with the sync version which actually uses the provided system:
```python
# chromadb/api/client.py
@classmethod
def from_system(cls, system: System, ...) -> "Client":
# Actually binds to the provided system
```
### Expected Behavior
`from_system_async(system)` should return a client bound to the exact `system` object passed in, not create a new one.
## Versions
- Chroma: latest `main`
- Python: 3.12
- OS: Linux
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.