Repository navigation
Python: Reuse Redis context index connection for schema validation - #9063
Open
LI (ktz03) wants to merge 1 commit into
Open
LI (ktz03) wants to merge 1 commit into
LI (ktz03) wants to merge 1 commit into
Conversation
LI (ktz03)
temporarily deployed
to
github-app-auth
October 5, 2026 15:43 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation addresses the reported connection mismatch and covers both construction paths and schema outcomes.
Review effort: Balanced
Findings: None
What changed in this PR
Reuses the active Redis index connection during schema validation, preventing accidental fallback to localhost or another server.
Changes:
- Passes the initialized index client to schema lookup.
- Adds four regression scenarios for injected/URL-created indexes and compatible/incompatible schemas.
- Updates the shared test fixture for client-based lookup.
| File | Description |
|---|---|
python/packages/redis/agent_framework_redis/_context_provider.py |
Reuses the active Redis client for schema validation. |
python/packages/redis/tests/test_context_provider_edges.py |
Tests connection reuse and schema rejection behavior. |
python/packages/redis/tests/test_providers.py |
Updates the mock schema loader signature. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
LI (ktz03)
had a problem deploying
to
github-app-auth
October 5, 2026 16:01 — with
GitHub Actions
Error
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:33 — with
GitHub Actions
Inactive
5 of 7 tasks
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
An existing Redis context index can use a connection supplied through
redis_index, while schema validation opens another connection using the provider'sredis_url. With an injected index, that URL can still be the default localhost endpoint. Initialization should inspect the schema on the same Redis connection used to check index existence.Description & Review Guide
exists()initializes the client, and preservation of the incompatible-schema rejection path.Related Issue
Fixes #9062
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.