Repository navigation
Python: Preserve image-only messages in Azure AI Search retrieval - #9075
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 12, 2026
Conversation
LI (ktz03)
temporarily deployed
to
github-app-auth
October 5, 2026 18:00 — with
GitHub Actions
Inactive
LI (ktz03)
temporarily deployed
to
github-app-auth
October 5, 2026 18:01 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix matches the existing image-conversion contract and has targeted regression coverage with no unresolved findings.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes #9074 by preserving supported image-only messages for Azure AI Search agentic retrieval.
Changes:
- Includes images in
lowandmediumreasoning modes before applying history limits. - Adds 28 regression cases while preserving text-only modes and unsupported-content filtering.
| File | Description |
|---|---|
| python/packages/azure-ai-search/tests/test_aisearch_context_provider.py | Tests image retrieval, history selection, and excluded inputs. |
| python/packages/azure-ai-search/agent_framework_azure_ai_search/_context_provider.py | Retains eligible image messages for messages-based retrieval. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
LI (ktz03)
marked this pull request as ready for review
October 9, 2026 02:33
LI (ktz03)
temporarily deployed
to
github-app-auth
October 9, 2026 02:34 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 12, 2026
This branch was previously 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
AzureAISearchContextProvider.before_run()filters every message by text content before choosing a retrieval mode. That drops image-only messages before the existing knowledge-base image converter can handle them. With a one-message history limit, a previous text message is sent instead of the latest image.Description & Review Guide
lowandmediumreasoning before applying the history limit. Image eligibility matches the existing converter. Add regressions throughbefore_runfor retrieval requests, user/assistant roles, image forms, history selection, and unsupported content.minimalmode remain text-based; system messages, non-image attachments, and empty inputs remain excluded. The 28 new cases reproduce 14 failures with 14 passing controls before the fix and all pass afterward. On Windows/Python 3.14.3, the package's non-integration suite passes 417 tests with stable SDK 12.0.0 and skips 12 for unavailable SDK capabilities; preview SDK 12.1.0b2 passes all 429 tests with 96% coverage. Both runs deselect one integration test and retain one existing experimental-filter warning. Ruff, source Pyright, all five test type checkers, applicable pre-commit hooks, and wheel/sdist builds pass. A separate 13-case check uses real preview SDK request serialization with discovery/transport substitutes; it does not exercise Azure service retrieval, image downloads, authentication deployment, or models.Related Issue
Fixes #9074
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.