Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#8526·agent-framework

.NET: [Bug]: Agent chat completions endpoint does not terminate SSE stream with data: [DONE]\n\n

Author: baonguyenrb21Created Sep 18, 2026Updated Sep 18, 2026
Labels.NETreproducedhosting

Description

  • The agent chat completions endpoint does not reliably write a data: [DONE]\n\n event at the end of the SSE stream. The stream closes without the terminator event that OpenAI-compatible clients expect.
  • The SSE stream should terminate with data: [DONE]\n\n, consistent with the OpenAI SSE specification. Clients that rely on the [DONE] signal to detect stream completion will hang or timeout.
  • Steps to reproduce the issue:
    • Register an agent chat completions endpoint
    • Send a request that produces a streaming SSE response
    • Observe that the stream closes without a final data: [DONE]\n\n event
  • We implemented an opt-in middleware that wraps the response body and appends data: [DONE]\n\n if the endpoint didn't already write it.

Code Sample

markdown

Error Messages / Stack Traces

markdown

Package Versions

Microsoft.Agents.AI 1.17.0; Microsoft.Agents.AI.Hosting.OpenAI 1.17.0-alpha.260804.1; Microsoft.Agents.AI.Hosting.AGUI.AspNetCore 1.17.0-preview.260804.1

.NET Version

NET 10.0

Additional Context

This requires consumers to implement custom middleware or post-processing to detect stream end, which is fragile. The chat completions endpoint should terminate its SSE stream with data: [DONE]\n\n per the OpenAI SSE convention.

Source: microsoft/agent-framework

View original on GitHubView discussion on GitHub