Skip to content

feat: #3017 add ValkeySession provider for session memory#3018

Draft
daric93 wants to merge 2 commits intoopenai:mainfrom
daric93:feat/valkey-session
Draft

feat: #3017 add ValkeySession provider for session memory#3018
daric93 wants to merge 2 commits intoopenai:mainfrom
daric93:feat/valkey-session

Conversation

@daric93
Copy link
Copy Markdown

@daric93 daric93 commented Apr 23, 2026

Closes #3017

Summary

Adds ValkeySession, a session memory backend using the Valkey-GLIDE client library. Follows the same patterns as RedisSession — implements the Session protocol, supports TTL, from_url factory, client ownership tracking, and pipelined writes via Batch.

Changes

  • Implementation (valkey_session.py): ValkeySession class with get_items, add_items, pop_item, clear_session, ping, close, from_url. Uses Batch for pipelined writes (on par with Redis's pipeline). Supports valkey://, valkeys://, redis://, rediss:// URL schemes and ServerCredentials for auth.
  • Registration (init.py): Lazy import with pip install openai-agents[valkey] error message.
  • Dependency (pyproject.toml): valkey = ["valkey-glide>=2.1"] optional extra, mypy override for glide.
  • Unit tests (test_valkey_session.py): 29 tests with lightweight in-memory stub — CRUD, limits, TTL, isolation, ownership, corrupted data, URL parsing, Runner integration.
  • Integration tests (test_valkey_integration.py): 29 tests against a real Valkey server via testcontainers (DockerContainer + wait_for_logs, same pattern as test_dapr_redis_integration.py). Skips when Docker is unavailable.
  • Docs (index.md, valkey_session.md, mkdocs.yml): Added to comparison table, dedicated section with examples, API reference stub, nav entry.

@github-actions github-actions Bot added dependencies documentation Improvements or additions to documentation enhancement New feature or request feature:extensions project labels Apr 23, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69e4857431

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/memory/valkey_session.py
Comment thread src/agents/extensions/memory/valkey_session.py Outdated
@seratch
Copy link
Copy Markdown
Member

seratch commented Apr 23, 2026

As I mentioned at #3017 (comment), we don't plan to add this in the short term, but we may revisit it if many developers need it.

@seratch seratch marked this pull request as draft April 23, 2026 23:08
@seratch seratch changed the title feat: add ValkeySession provider for session memory feat: #3017 add ValkeySession provider for session memory Apr 23, 2026
daric93 added 2 commits April 23, 2026 16:28
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
@daric93 daric93 force-pushed the feat/valkey-session branch from 69e4857 to 841e294 Compare April 24, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation enhancement New feature or request feature:extensions project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ValkeySession provider for session memory

2 participants