Repository navigation
[BREAKING] Python: Honor injected Azure AI Search clients over settings - #10001
Open
lsmlhi_25 (FOWEPJF255) wants to merge 2 commits into
Open
lsmlhi_25 (FOWEPJF255) wants to merge 2 commits into
lsmlhi_25 (FOWEPJF255) wants to merge 2 commits into
Conversation
lsmlhi_25 (FOWEPJF255)
temporarily deployed
to
github-app-auth
November 3, 2026 01:47 — with
GitHub Actions
Inactive
lsmlhi_25 (FOWEPJF255)
temporarily deployed
to
github-app-auth
November 3, 2026 01:48 — with
GitHub Actions
Inactive
lsmlhi_25 (FOWEPJF255)
marked this pull request as ready for review
November 3, 2026 01:49
lsmlhi_25 (FOWEPJF255)
temporarily deployed
to
github-app-auth
November 3, 2026 01:49 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the injected-client precedence and ownership changes.
No open issues 🎉
What changed in this PR
This PR addresses #9956 by making injected Azure AI Search clients take precedence over connection settings and remain caller-owned. This intentionally breaks cleanup behavior for callers that previously used managed_client=True to transfer ownership.
Changes:
- Accept connection and settings-file arguments alongside injected clients without resolving those settings.
- Preserve cleanup of connector-created clients, including search clients derived from an injected index client.
- Update regression tests and documentation to reflect the precedence and ownership rules.
| File | Description |
|---|---|
python/packages/azure-ai-search/tests/test_vector_store.py |
Updates ownership assertions and tests injected-client precedence over explicit settings. |
python/packages/azure-ai-search/README.md |
Documents caller ownership even with managed_client=True. |
python/packages/azure-ai-search/AGENTS.md |
Aligns connector guidance with settings bypass and ownership behavior. |
python/packages/azure-ai-search/agent_framework_azure_ai_search/_vector_store.py |
Removes settings conflicts and limits cleanup ownership to connector-created clients. |
Review effort: Balanced
lsmlhi_25 (FOWEPJF255)
deployed
to
github-app-auth
November 4, 2026 11:26 — with
GitHub Actions
Active
Contributor
Author
|
The merge gate identified type narrowing errors in the new precedence test. I split the store and collection assertions into their respective branches and pushed dd1e9fd. The 20 targeted cases, Ruff, and all five azure-ai-search test typing checkers pass locally; CI is rerunning. |
This branch was successfully deployed
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.
Motivation & Context
An application that injects a working Azure AI Search SDK client cannot currently pass an endpoint, credential, API key, or settings-file option to the store or collection constructor: construction raises before the supplied client is used. Passing
managed_client=Truecan also cause the connector to close that caller-owned client. This blocks dependency-injected retrieval setups that carry ambient connection configuration.Description & Review Guide
managed_client=Trueremains accepted for compatibility but no longer transfers ownership of an injected client, so callers relying on that cleanup must close their client themselves.Related Issue
Fixes #9956
AI Assistance
AI assistance details: Issue analysis, implementation, regression tests, connector documentation, and this description were materially assisted by an AI coding assistant. The change was reviewed against the source and verified with the package's non-integration tests, Ruff, and Pyright.
Contribution Checklist
[BREAKING]for review.