Repository navigation
.NET: valkey streaming support dotnet - #5576
Open
Matthias Howell (MatthiasHowellYopp) wants to merge 3 commits into
Open
Matthias Howell (MatthiasHowellYopp) wants to merge 3 commits into
Matthias Howell (MatthiasHowellYopp) wants to merge 3 commits into
Conversation
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
April 29, 2026 19:16
bf4714b to
f934220
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
5 times, most recently
from
May 5, 2026 20:43
ee7312c to
9701441
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
3 times, most recently
from
May 14, 2026 14:29
bd5b982 to
99bcf8f
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
3 times, most recently
from
May 20, 2026 15:16
c394fda to
8751b4a
Compare
Contributor
Author
|
westey (@westey-m) Hoping I can get a review on this this week, tks |
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
4 times, most recently
from
May 26, 2026 13:36
1253dd2 to
3fbdfa9
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
3 times, most recently
from
June 4, 2026 16:43
aad29ac to
ff0f1fa
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
4 times, most recently
from
June 11, 2026 13:52
bbe3fea to
a2ce36d
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
August 17, 2026 20:33 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
August 26, 2026 18:43
8847fca to
096c105
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
August 26, 2026 18:44 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
August 27, 2026 12:40
096c105 to
11c9d98
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
August 27, 2026 12:40 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 1, 2026 18:19
11c9d98 to
0665590
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 1, 2026 18:19 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 9, 2026 14:22
0665590 to
3605a46
Compare
Matthias Howell (MatthiasHowellYopp)
requested review from
Vincent Biret (baywet) and
Jose Alvarez (jpalvarezl)
as code owners
September 9, 2026 14:22
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 9, 2026 14:22 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 11, 2026 18:57
3605a46 to
db78068
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 11, 2026 18:58 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 15, 2026 14:16
db78068 to
78be6a6
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 15, 2026 14:16 — with
GitHub Actions
Inactive
Contributor
Author
|
westey (@westey-m) Hoping I can get a review this week on this, thanks. |
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 16, 2026 17:36
78be6a6 to
6bd986c
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 16, 2026 17:36 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
September 23, 2026 13:13
6bd986c to
41630c1
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
github-app-auth
September 23, 2026 13:13 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5544
branch
from
October 13, 2026 18:23
41630c1 to
df43e07
Compare
Adds ValkeyStreamBuffer — a resumable streaming buffer backed by Valkey Streams (XADD/XRANGE). Enables clients to disconnect and reconnect mid-stream without data loss using entry ID-based continuation tokens. - ValkeyStreamBuffer with AppendAsync, ReadAsync, GetEntryCountAsync, DeleteStreamAsync - ValkeyStreamBufferOptions (KeyPrefix, MaxLength, JsonSerializerOptions) - Uses Valkey.Glide with type-safe JSON serialization - Unit tests with mocked client - Sample demonstrating append, disconnect, and resume workflow Signed-off-by: Matthias Howell <matthias.howell@improving.com>
Signed-off-by: Matthias Howell <matthias.howell@improving.com>
Upstream added AgentWithMemory_Step08_MemoryUsingCosmosNoSql, which collides with this sample's step number. Bump to Step09 to avoid the naming conflict. Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
This branch was successfully 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 and Context
The Microsoft.Agents.AI.Valkey package provides ValkeyChatHistoryProvider and ValkeyContextProvider for persistent conversation history and memory context. However, the framework currently has no storage-backed resumable streaming component — if a client disconnects during a streamed agent response (RunStreamingAsync), partial output is lost and must be regenerated. This is the final piece of the Valkey integration story, delivering parity with the Python agent-framework-valkey package.
Valkey Streams (XADD/XRANGE) are a natural fit: each entry gets an auto-generated ID that serves as a continuation token, entries are append-only and durable, and XRANGE with an exclusive start ID gives exact resume-from-here semantics — all with core commands, no modules required.
Fixes issue #5544
Description
Adds ValkeyStreamBuffer to the Microsoft.Agents.AI.Valkey package — a resumable streaming buffer backed by Valkey Streams.
The component writes serialized AgentResponseUpdate chunks to a Valkey Stream via XADD and replays missed entries via XRANGE from a caller-provided entry ID. The stream entry ID returned by each AppendAsync call serves as the continuation token for resumption.
Public API:
Follows the same patterns as the existing Valkey providers: dual constructors (connection string + IConnectionMultiplexer for DI), IAsyncDisposable with disposed-state guard, CancellationToken forwarding, malformed JSON resilience, trimming/AOT attributes, and ILogger integration at appropriate levels (Debug for per-request, Warning for skipped entries).
Includes a self-contained sample (AgentWithMemory_Step06_ResumableStreamingWithValkey) that demonstrates the full workflow — stream, disconnect, resume, full replay — against a live Valkey instance with no LLM or cloud credentials required.
64 unit tests passing, covering constructor validation, append/read round-trips, entry ID incrementing, MaxLength pass-through, malformed entry handling, cancellation, disposal guards, and empty stream edge cases.
Contribution Checklist