Python: Fix Redis samples for session migration and configurable REDIS_URL#4060
Merged
giles17 merged 2 commits intomicrosoft:mainfrom Feb 19, 2026
Merged
Python: Fix Redis samples for session migration and configurable REDIS_URL#4060giles17 merged 2 commits intomicrosoft:mainfrom
giles17 merged 2 commits intomicrosoft:mainfrom
Conversation
…S_URL - Replace hardcoded redis://localhost:6379 with configurable REDIS_URL env var - Fix SessionContext usage: use input_messages kwarg instead of removed extend_messages - Remove obsolete scope_to_per_operation_thread_id parameter - Remove stale commented-out overwrite_redis_index/drop_redis_index params Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the Redis context provider samples to work with the current API after the AgentThread → AgentSession migration. The changes ensure the samples run correctly with the updated framework APIs while improving configurability.
Changes:
- Add configurable
REDIS_URLenvironment variable across all Redis samples (defaults toredis://localhost:6379) - Fix
SessionContextAPI usage inredis_basics.pyto use the correct constructor withinput_messages=parameter - Remove obsolete
scope_to_per_operation_thread_idparameter fromRedisContextProviderinstantiations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
python/samples/02-agents/context_providers/redis/redis_sessions.py |
Add REDIS_URL env var; remove obsolete scope_to_per_operation_thread_id parameter and stale commented parameters |
python/samples/02-agents/context_providers/redis/redis_conversation.py |
Add REDIS_URL env var for consistency |
python/samples/02-agents/context_providers/redis/redis_basics.py |
Add REDIS_URL env var; fix SessionContext constructor usage to use input_messages= parameter |
dmytrostruk
approved these changes
Feb 19, 2026
TaoChenOSU
approved these changes
Feb 19, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmytrostruk
approved these changes
Feb 19, 2026
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.
Summary
Update Redis context provider samples to work with the current API after the AgentThread → AgentSession migration.
Changes
redis://localhost:6379withREDIS_URLenv var (defaults to localhost) across all 3 samplesSessionContext(input_messages=...)constructor instead of removedextend_messages()method inredis_basics.pyscope_to_per_operation_thread_id(no longer exists onRedisContextProvider) and stale commented-outoverwrite_redis_index/drop_redis_indexparams inredis_sessions.pyFiles Changed
python/samples/02-agents/context_providers/redis/redis_basics.pypython/samples/02-agents/context_providers/redis/redis_conversation.pypython/samples/02-agents/context_providers/redis/redis_sessions.py