Skip to content

Python: Fix Redis samples for session migration and configurable REDIS_URL#4060

Merged
giles17 merged 2 commits intomicrosoft:mainfrom
giles17:redis-samples-cleanup
Feb 19, 2026
Merged

Python: Fix Redis samples for session migration and configurable REDIS_URL#4060
giles17 merged 2 commits intomicrosoft:mainfrom
giles17:redis-samples-cleanup

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Feb 19, 2026

Summary

Update Redis context provider samples to work with the current API after the AgentThread → AgentSession migration.

Changes

  • Configurable REDIS_URL: Replace hardcoded redis://localhost:6379 with REDIS_URL env var (defaults to localhost) across all 3 samples
  • Fix SessionContext API: Use SessionContext(input_messages=...) constructor instead of removed extend_messages() method in redis_basics.py
  • Remove obsolete parameters: Remove scope_to_per_operation_thread_id (no longer exists on RedisContextProvider) and stale commented-out overwrite_redis_index/drop_redis_index params in redis_sessions.py

Files Changed

  • python/samples/02-agents/context_providers/redis/redis_basics.py
  • python/samples/02-agents/context_providers/redis/redis_conversation.py
  • python/samples/02-agents/context_providers/redis/redis_sessions.py

…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>
Copilot AI review requested due to automatic review settings February 19, 2026 00:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_URL environment variable across all Redis samples (defaults to redis://localhost:6379)
  • Fix SessionContext API usage in redis_basics.py to use the correct constructor with input_messages= parameter
  • Remove obsolete scope_to_per_operation_thread_id parameter from RedisContextProvider instantiations

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

@giles17 giles17 enabled auto-merge February 19, 2026 00:55
@giles17 giles17 added this pull request to the merge queue Feb 19, 2026
@giles17 giles17 removed this pull request from the merge queue due to a manual request Feb 19, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giles17 giles17 enabled auto-merge February 19, 2026 04:20
@giles17 giles17 added this pull request to the merge queue Feb 19, 2026
Merged via the queue into microsoft:main with commit 6fd5046 Feb 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments