Skip to content

Comments

channel check changes needed for M365Copilot#208

Merged
axelsrz merged 3 commits intomainfrom
users/axsuarez/m365-streaming-fix
Oct 28, 2025
Merged

channel check changes needed for M365Copilot#208
axelsrz merged 3 commits intomainfrom
users/axsuarez/m365-streaming-fix

Conversation

@axelsrz
Copy link
Member

@axelsrz axelsrz commented Oct 27, 2025

This pull request introduces improvements to the streaming response logic for channel detection and activity creation in streaming_response.py. The main changes focus on making channel identification more flexible and enhancing the metadata included in streaming entities.

Streaming channel detection:

  • Updated the logic in _set_defaults to use substring checks (in) instead of strict equality for channel_id, making channel detection more robust for both MS Teams and Direct Line channels.

Activity entity enrichment:

  • Added the stream_id field to the Entity object when creating an activity, providing additional metadata for stream tracking.

Copilot AI review requested due to automatic review settings October 27, 2025 23:39
@axelsrz axelsrz requested a review from a team as a code owner October 27, 2025 23:39
Copy link
Contributor

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 pull request enhances the streaming response logic for channel detection and activity metadata. The changes make channel identification more flexible by using substring matching instead of exact equality, and enrich streaming entities with stream tracking information.

Key changes:

  • Modified channel detection to use substring checks instead of strict equality for both MS Teams and Direct Line channels
  • Added stream_id field to the Entity object for improved stream tracking metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings October 28, 2025 18:22
Copy link
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py:337

  • Inconsistent channel_id comparison pattern. This line should be updated to use .channel property like the other comparisons in this file (lines 253 and 256). It should be: Channels.ms_teams == self._context.activity.channel_id.channel
                and self._context.activity.channel_id == Channels.ms_teams

libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py:302

  • The streaming Entity (lines 300-302) is missing the stream_id parameter, while the final Entity (lines 286-289) now includes it. For consistency and to ensure proper stream tracking, consider adding stream_id=self._stream_id to the streaming Entity as well, similar to the final Entity.
                            type="streaminfo",
                            stream_type="streaming",
                            stream_sequence=self._sequence_number,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@axelsrz axelsrz dismissed rodrigobr-msft’s stale review October 28, 2025 18:43

Changes implemented

@axelsrz axelsrz merged commit 39f31ba into main Oct 28, 2025
16 checks passed
@axelsrz axelsrz deleted the users/axsuarez/m365-streaming-fix branch October 28, 2025 18:43
axelsrz added a commit that referenced this pull request Oct 28, 2025
* channel check changes needed for M365Copilot

* improving main channel check syntax
axelsrz added a commit that referenced this pull request Oct 28, 2025
* channel check changes needed for M365Copilot (#208)

* channel check changes needed for M365Copilot

* improving main channel check syntax

* Temporal fix for typing indicator (#209)
Copilot AI mentioned this pull request Dec 2, 2025
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.

3 participants