Skip to content

Streaming fix (again) for sending final even when no text buffered #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

tracyboehrer
Copy link
Member

@tracyboehrer tracyboehrer commented Jun 2, 2025

Fixes #310

See original notes in #313

@Copilot Copilot AI review requested due to automatic review settings June 2, 2025 13:09
@tracyboehrer tracyboehrer requested a review from a team as a code owner June 2, 2025 13:09
@github-actions github-actions bot added the ML: Core Tags changes to core libraries label Jun 2, 2025
@tracyboehrer tracyboehrer enabled auto-merge June 2, 2025 13:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Ensures the final streaming response always contains text even if no content was buffered.

  • Use a conditional to assign a default message when Message is null or empty
  • Preserve existing logic around Activity.Entities
Comments suppressed due to low confidence (1)

src/libraries/Builder/Microsoft.Agents.Builder/StreamingResponse.cs:319

  • Add a unit test to verify that when Message is null or empty, CreateFinalMessage sets activity.Text to the fallback string. This will help prevent regressions.
activity.Text = !string.IsNullOrEmpty(Message) ? Message : "No text was streamed";   // Teams won't allow Activity.Text changes or empty text

@tracyboehrer tracyboehrer merged commit c07797f into main Jun 3, 2025
8 checks passed
@tracyboehrer tracyboehrer deleted the users/tracyboehrer/streaming-fix-again branch June 3, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ML: Core Tags changes to core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EndOfStream does not trigger if QueueTextChunk has not been called
2 participants