Skip to content

[WIP] Fix OnIntermediateMessage callback behavior - Always yield responses#813

Merged
Bryan-Roe merged 2 commits intomainfrom
copilot/fix-c358e8b2-195d-46f3-8da3-bf597964d6be
Aug 9, 2025
Merged

[WIP] Fix OnIntermediateMessage callback behavior - Always yield responses#813
Bryan-Roe merged 2 commits intomainfrom
copilot/fix-c358e8b2-195d-46f3-8da3-bf597964d6be

Conversation

Copy link

Copilot AI commented Aug 7, 2025

Summary

Fix the callback behavior issues where responses are not yielded when options.OnIntermediateMessage is null. The method should yield responses regardless of the callback status to maintain consistency with previous behavior.

Issues to Address

Implementation Requirements

  1. For non-streaming implementation: Ensure the method yields a response even when options.OnIntermediateMessage is null
  2. For streaming implementation: Ensure InvokeStreamingAsync yields streaming responses even when the callback is null
  3. Maintain backward compatibility: Ensure existing functionality continues to work

Expected Changes

  • Add an else branch to yield responseItem when callback is null
  • Apply similar logic to both streaming and non-streaming implementations
  • Add unit tests to verify the new behavior
  • Update documentation if necessary

Acceptance Criteria

  • Both streaming and non-streaming methods yield responses when callback is null
  • Existing callback functionality remains unchanged
  • Unit tests pass
  • No breaking changes to API

Files Likely to be Modified

  • Streaming response handling code
  • Non-streaming response handling code
  • Related unit tests

Copilot AI requested a review from Bryan-Roe August 7, 2025 16:51
Base automatically changed from copilot/vscode1754584977153 to main August 7, 2025 17:39
@Bryan-Roe Bryan-Roe marked this pull request as ready for review August 9, 2025 04:22
Copilot AI review requested due to automatic review settings August 9, 2025 04:22
Copy link

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.

Copilot wasn't able to review any files in this pull request.

@Bryan-Roe Bryan-Roe merged commit 12511e1 into main Aug 9, 2025
0 of 3 checks passed
@Bryan-Roe Bryan-Roe deleted the copilot/fix-c358e8b2-195d-46f3-8da3-bf597964d6be branch August 9, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants