Skip to content

fix(chroma): reject async chroma clients with a clear error#36692

Closed
lakshayt7 wants to merge 2 commits intolangchain-ai:masterfrom
lakshayt7:codex/langchain-chroma-async-client-guard
Closed

fix(chroma): reject async chroma clients with a clear error#36692
lakshayt7 wants to merge 2 commits intolangchain-ai:masterfrom
lakshayt7:codex/langchain-chroma-async-client-guard

Conversation

@lakshayt7
Copy link
Copy Markdown

@lakshayt7 lakshayt7 commented Apr 13, 2026

Fixes #30704

Summary

Reject awaitable Chroma clients passed to langchain_chroma.Chroma with a clear TypeError instead of failing later with an AttributeError.

Why

Passing chromadb.AsyncHttpClient(...) currently produces an awaitable, and Chroma later crashes during collection setup with 'coroutine' object has no attribute 'get_or_create_collection'. This change fails fast with an actionable message that points users to a synchronous client.

Changes

  • validate client during Chroma initialization
  • raise a clear TypeError when an awaitable client is provided
  • add a regression test for chromadb.AsyncHttpClient(...)

Testing

  • pytest tests/unit_tests/test_vectorstores.py -q

AI Disclosure

This PR was prepared with assistance from an AI coding agent, then reviewed and submitted by me.

@github-actions github-actions bot added chroma `langchain-chroma` package issues & PRs fix For PRs that implement a fix integration PR made that is related to a provider partner package integration size: XS < 50 LOC labels Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

This PR has been automatically closed because you are not assigned to the linked issue.

External contributors must be assigned to an issue before opening a PR for it. Please:

  1. Comment on the linked issue to request assignment from a maintainer
  2. Once assigned, your PR will be reopened automatically

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chroma `langchain-chroma` package issues & PRs external fix For PRs that implement a fix integration PR made that is related to a provider partner package integration missing-issue-link new-contributor size: XS < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

langchain_chroma.Chroma used with chromadb.AsyncHttpClient?

1 participant