From 82b02cef438a8fe3639eece745aa535705cf7954 Mon Sep 17 00:00:00 2001 From: Axel Suarez Date: Mon, 27 Oct 2025 16:38:41 -0700 Subject: [PATCH 1/2] channel check changes needed for M365Copilot --- .../hosting/aiohttp/app/streaming/streaming_response.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py index 4c1cff5b..c7766ccd 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py @@ -250,10 +250,10 @@ async def wait_for_queue(self) -> None: await self._queue_sync def _set_defaults(self, context: "TurnContext"): - if context.activity.channel_id == Channels.ms_teams: + if Channels.ms_teams in context.activity.channel_id: self._is_streaming_channel = True self._interval = 1.0 - elif context.activity.channel_id == Channels.direct_line: + elif Channels.direct_line in context.activity.channel_id: self._is_streaming_channel = True self._interval = 0.5 elif context.activity.delivery_mode == DeliveryModes.stream: @@ -284,6 +284,7 @@ def create_activity(): entities=[ Entity( type="streaminfo", + stream_id=self._stream_id, stream_type="final", stream_sequence=self._sequence_number, ) From 8d780d9440b7fe7519526ca30abc8ce3d58d7c9c Mon Sep 17 00:00:00 2001 From: Axel Suarez Date: Tue, 28 Oct 2025 11:16:33 -0700 Subject: [PATCH 2/2] improving main channel check syntax --- .../hosting/aiohttp/app/streaming/streaming_response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py index c7766ccd..db57858b 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py @@ -250,10 +250,10 @@ async def wait_for_queue(self) -> None: await self._queue_sync def _set_defaults(self, context: "TurnContext"): - if Channels.ms_teams in context.activity.channel_id: + if Channels.ms_teams == context.activity.channel_id.channel: self._is_streaming_channel = True self._interval = 1.0 - elif Channels.direct_line in context.activity.channel_id: + elif Channels.direct_line == context.activity.channel_id.channel: self._is_streaming_channel = True self._interval = 0.5 elif context.activity.delivery_mode == DeliveryModes.stream: