Skip to content

Fix for Streaming bug when working with a client that does not support streaming #337

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 5 commits into from
Jun 24, 2025

Conversation

MattB-msft
Copy link
Member

  • Added a check for non-empty Message in StreamingResponse.cs to ensure final messages are sent.
  • Updated ErrorResponseException.cs to include new namespaces and improve HTTP response content reading.
  • Implemented robust error handling by checking for null or empty errorBody and attempting to extract specific error messages.

- Added a check for non-empty `Message` in `StreamingResponse.cs` to ensure final messages are sent.
- Updated `ErrorResponseException.cs` to include new namespaces and improve HTTP response content reading.
- Implemented robust error handling by checking for null or empty `errorBody` and attempting to extract specific error messages.
@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 23:13
@MattB-msft MattB-msft requested a review from a team as a code owner June 23, 2025 23:13
@github-actions github-actions bot added the ML: Core Tags changes to core libraries label Jun 23, 2025
Copilot

This comment was marked as outdated.

MattB-msft and others added 3 commits June 23, 2025 16:14
…xception.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Added a conditional check in `StreamingResponse.cs` to append `StreamInfo` only if the channel supports streaming. Improved error handling in `ErrorResponseException.cs` by validating `responseContent` before deserialization, ensuring robustness and proper extraction of error messages.
@MattB-msft MattB-msft requested a review from Copilot June 24, 2025 00:58
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

This PR enhances response handling and error processing by ensuring final messages are sent and improving error deserialization for better HTTP error content extraction.

  • Updated error response deserialization to handle empty error bodies and extract more specific error messages.
  • Added a check on the Message field in StreamingResponse to determine when to send the final message.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/libraries/Core/Microsoft.Agents.Core/Errors/ErrorResponseException.cs Improves error body processing with additional deserialization logic for better error details.
src/libraries/Builder/Microsoft.Agents.Builder/StreamingResponse.cs Enhances final message sending condition by checking for non-empty Message content.

…xception.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MattB-msft MattB-msft enabled auto-merge (squash) June 24, 2025 01:06
@MattB-msft MattB-msft changed the title Enhance response handling and error processing Fix for Streaming bug when working with a client that does not support streaming Jun 24, 2025
@MattB-msft MattB-msft merged commit d3f8fc7 into main Jun 24, 2025
8 checks passed
@MattB-msft MattB-msft deleted the users/mbarbour/fixStreamingBug branch June 24, 2025 12:35
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.

2 participants