Skip to content

.NET: [Durable Agents] Reliable streaming sample - #2942

Merged
Chris Gillum (cgillum) merged 5 commits into
microsoft:mainfrom
cgillum:cgillum/durable-agent-streaming
Dec 20, 2025
Merged

.NET: [Durable Agents] Reliable streaming sample#2942
Chris Gillum (cgillum) merged 5 commits into
microsoft:mainfrom
cgillum:cgillum/durable-agent-streaming

Conversation

@cgillum

@cgillumChris Gillum (cgillum) commented Dec 17, 2025

Copy link
Copy Markdown
Member

Motivation and Context

Interactive clients require streaming support, something that durable agents doesn't support out-of-the-box. A sample is needed to demonstrate how this can be achieved, in this case with the help of Redis streaming.

Tracked by #2644

Description

This .NET samples shows how to use Redis streams in an Azure Functions app to implement agent response streaming for durable agents. The sample also provides a step-by-step guide demonstrating how to resume broken streams. This sample is a bit more comprehensive than the other samples.

No product code is changed in this PR, though a new dependency on StackExchange.Redis has been added to central package management.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@cgillumChris Gillum (cgillum) added .NET Usage: [Issues, PRs], Target: .Net azure-functions labels Dec 17, 2025
@markwallace-microsoftMark Wallace (markwallace-microsoft) added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Dec 17, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new comprehensive sample (08_ReliableStreaming) demonstrating how to implement reliable streaming for durable agents using Redis Streams. The sample enables clients to disconnect and reconnect to ongoing agent responses without losing messages, inspired by OpenAI's background mode for the Responses API.

Key Changes

  • New sample demonstrating Redis Streams integration for reliable agent response streaming with cursor-based resumption
  • Support for both Server-Sent Events (SSE) and plain text streaming formats based on Accept headers
  • Integration test validation with automated Redis container management in CI/CD pipeline

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
dotnet/samples/AzureFunctions/08_ReliableStreaming/08_ReliableStreaming.csprojProject configuration with StackExchange.Redis dependency
dotnet/samples/AzureFunctions/08_ReliableStreaming/Program.csApplication entry point configuring Redis connection, travel planner agent, and response handler
dotnet/samples/AzureFunctions/08_ReliableStreaming/FunctionTriggers.csHTTP endpoints for creating and resuming streams with content negotiation support
dotnet/samples/AzureFunctions/08_ReliableStreaming/RedisStreamResponseHandler.csIAgentResponseHandler implementation publishing responses to Redis Streams with TTL management
dotnet/samples/AzureFunctions/08_ReliableStreaming/Tools.csMock travel tools providing weather forecasts and local events for demonstration
dotnet/samples/AzureFunctions/08_ReliableStreaming/README.mdComprehensive documentation with step-by-step instructions for testing stream interruption and resumption
dotnet/samples/AzureFunctions/08_ReliableStreaming/host.jsonAzure Functions host configuration for durable task extensions
dotnet/samples/AzureFunctions/08_ReliableStreaming/local.settings.jsonLocal development settings including Redis connection configuration
dotnet/samples/AzureFunctions/README.mdUpdated parent README to reference new sample
dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.csIntegration test validating stream creation, interruption, and resumption with Redis container setup
dotnet/agent-framework-dotnet.slnxSolution file updated to include new sample project
dotnet/Directory.Packages.propsAdded StackExchange.Redis package version for central package management
.github/actions/azure-functions-integration-setup/action.ymlCI/CD setup for starting and managing Redis container in integration tests

Comment threaddotnet/samples/AzureFunctions/08_ReliableStreaming/README.md Outdated
Comment threaddotnet/samples/AzureFunctions/08_ReliableStreaming/FunctionTriggers.cs Outdated
Comment threaddotnet/samples/AzureFunctions/08_ReliableStreaming/FunctionTriggers.cs Outdated
@cgillum
Chris Gillum (cgillum) added this pull request to the merge queueDec 19, 2025
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Dec 19, 2025
@moonbox3Evan Mattson (moonbox3) added hosting Usage: [Issues, PRs], Target: all hosting related solutions and removed azure-functions labels Jun 17, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUsage: [Issues, PRs], Target: documentation in the code base and learn docshostingUsage: [Issues, PRs], Target: all hosting related solutions.NETUsage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants

@cgillum@vrdmr@gavin-aguiar@moonbox3@markwallace-microsoft