Skip to content

Python: [Bug]: Qdrant injected clients do not take precedence over settings and lifecycle #9957

Closed

Description

Observed Behavior

QdrantStore and QdrantCollection reject URL, API-key, and .env options when async_client is injected. They also allow managed_client=True to make the framework close a caller-supplied client.

Affected file: python/packages/qdrant/agent_framework_qdrant/_vector_store.py.

Expected Behavior

An injected AsyncQdrantClient should take precedence over all client-construction settings. Those settings should not be read or validated, and the injected client should always remain caller-owned. Collection schema and operation options continue to apply normally.

Steps to Reproduce

  1. Create a caller-owned AsyncQdrantClient.
  2. Pass it to QdrantStore with url, api_key, or .env options and observe the conflict error.
  3. Pass managed_client=True, close the store, and observe cleanup of the injected client.

Minimal Reproduction

from unittest.mock import AsyncMock
from qdrant_client import AsyncQdrantClient
from agent_framework_qdrant import QdrantStore

client = AsyncMock(spec=AsyncQdrantClient)
QdrantStore(async_client=client, url="https://ignored.example")

Error Messages and Stack Traces

ValueError: Pass async_client or connection settings, not both.

Package Versions

agent-framework-qdrant: 1.0.0a261030; main at 93c346f

Python Version

Python 3.13.1

Operating System

macOS

Regression

Unknown

Additional Context

Compatibility impact: alpha behavior would stop raising for redundant settings, and injected-client ownership transfer through managed_client=True would be removed or deprecated.

Focused acceptance tests:

  • Injected clients bypass URL, API-key, and .env settings.
  • Invalid ambient Qdrant settings cannot block construction.
  • No client factory is called.
  • Store/collection cleanup never closes an injected client.
  • No-client explicit > environment > SDK-default behavior remains unchanged.

AI assistance: I used an AI coding assistant to audit and reproduce the behavior.

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I personally verified this behavior and the reproduction details are authentic.

Activity

  1. ZedingZhang commented on Nov 2, 2026

    @ZedingZhang
    Contributor

    I'll take this one, making injected AsyncQdrantClient take precedence over connection settings and remain caller-owned (ignore url/api_key/.env conflict; never close injected client on store/collection cleanup).

  2. added a commit that references this issue on Nov 3, 2026
    d615566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonUsage: [Issues, PRs], Target: Pythonready-for-implementationMaintainers agree the problem and direction are ready for implementation.

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions