Skip to content

ExpectReplies during OAuth not handled correctly #342

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

Closed

Conversation

tracyboehrer
Copy link
Member

@tracyboehrer tracyboehrer commented Jun 26, 2025

Fixes #338
Fixes #346

This PR instead performs a planned refactoring to have CloudAdapter handle both Stream and ExpectReply DeliveryModes via the (renamed to) ChannelResponseQueue. This resolves the bug, and simplifies TurnContext. It does complicate CloudAdapter a bit, but some of these changes were planned for A2A/MCP anyway.

  • There are a lot of unit test changes that aren't directly related to this change. Related to running in parallel changes and fixes stemming from that.
  • CloudAdapter and TurnContext are the largest changes.

Detail

The fundamental issue is that ExpectReplies was handled in TurnContext by buffering responses from the Agent (TurnContext.SendActivity). So, when the TurnContext switched (as would be the case during OAuth Continuation Activity handling), the responses were lost.

There are different ways to handle this. For example, use Adapter.ContinuationActivity and when that is complete, copy the buffered activities on the "inner" TurnContext to the "outer".

@github-actions github-actions bot added ML: Core Tags changes to core libraries ML: Tests Tags changes to tests labels Jun 26, 2025
@tracyboehrer tracyboehrer deleted the users/tracyboehrer/expectreplies-continuation branch July 1, 2025 15:48
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 ML: Packages ML: Tests Tags changes to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race in CloudAdapter can drop InvokeResponse ExpectReplies during OAuth not handled correctly
1 participant