Python: adds valkey streaming support (python)- issue 5517#5543
Open
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
Open
Python: adds valkey streaming support (python)- issue 5517#5543MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
Conversation
4332de6 to
1bd9e18
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-party Valkey-based resumable streaming support to the Python Agent Framework via a new agent-framework-valkey package and accompanying samples/tests.
Changes:
- Introduces
ValkeyStreamBuffer(+StreamChunk) backed by Valkey Streams usingvalkey-glide - Adds unit + integration test suites for stream write/read, cursor resumption, timeouts, and callback-protocol behavior
- Registers the new package in the Python workspace and provides a runnable sample + docs
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/04-hosting/valkey_stream_buffer/valkey_stream_buffer.py | Adds a runnable sample demonstrating basic streaming, resumption, and error propagation. |
| python/samples/04-hosting/valkey_stream_buffer/README.md | Documents how to run the Valkey stream buffer sample. |
| python/pyproject.toml | Registers agent-framework-valkey in the workspace and adjusts tooling environments. |
| python/packages/valkey/agent_framework_valkey/_stream_buffer.py | Implements ValkeyStreamBuffer and stream parsing helpers. |
| python/packages/valkey/agent_framework_valkey/init.py | Exposes public package API (ValkeyStreamBuffer, StreamChunk, __version__). |
| python/packages/valkey/pyproject.toml | Defines the new package metadata, dependencies, and test/tooling config. |
| python/packages/valkey/README.md | Adds package-level documentation and quick start usage. |
| python/packages/valkey/LICENSE | Adds MIT license file for the new package. |
| python/packages/valkey/tests/test_stream_buffer.py | Adds unit tests with a mocked glide client covering read/write + callback semantics. |
| python/packages/valkey/tests/test_stream_buffer_integration.py | Adds opt-in integration tests against a real Valkey server. |
| .gitignore | Ignores .kiro/ directory. |
98e98bc to
dfa31e5
Compare
dfa31e5 to
ff4742d
Compare
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 and Context
The Agent Framework currently has no Valkey-native streaming component. The existing resumable streaming samples (python/samples/04-hosting/azure_functions/03_reliable_streaming/) use a RedisStreamResponseHandler built on redis-py — a sample-level implementation that isn't packaged for reuse and creates a dependency mismatch for Valkey users.
This PR delivers ValkeyStreamBuffer, a first-party, reusable streaming buffer backed by Valkey Streams using the valkey-glide client. It enables durable agents to persist response chunks so clients can disconnect and reconnect mid-stream without data loss.
Related issue: [Python] Add ValkeyStreamBuffer — resumable streaming via Valkey Streams for agent-framework-valkey #5517
Description
Adds the agent-framework-valkey Python package with a single component: ValkeyStreamBuffer.
###Core implementation (_stream_buffer.py):
Package scaffolding:
Tests (test_stream_buffer.py — 31 tests):
Files changed:
init.py (new)
_stream_buffer.py (new)
test_stream_buffer.py (new)
pyproject.toml (new)
python/packages/valkey/LICENSE (new)
README.md (new)
pyproject.toml (workspace registration)
Contribution Checklist