Repository navigation
[#587] Feedback-Loop buttons and Generated-by-AI label not showing when ending a streaming - #592
Merged
Conversation
Cecilia Avila (ceciliaavila)
requested a review
from a team
as a code owner
September 18, 2026 13:05
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Timeout/stop terminal activities can lose the Generated-by-AI label.
Pull request overview
Improves streaming emission of Teams feedback-loop metadata and AI-generated labels, with expanded regression coverage.
Changes:
- Moves Teams feedback metadata to final
channelData. - Emits AI-generated metadata without citations.
- Preserves existing channel data and adds focused tests.
- Requires applying AI metadata to timeout/stop terminal messages.
File summaries
| File | Summary |
|---|---|
tests/hosting_core/app/streaming/test_streaming_response.py |
Tests streaming metadata behavior. |
tests/activity/test_activity.py |
Tests citation-free AI metadata. |
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/streaming/streaming_response.py |
Constructs final metadata; timeout/stop messages still need the AI label. |
libraries/microsoft-agents-activity/microsoft_agents/activity/activity.py |
Supports AI-generated entities without citations. |
Review details
Suppressed comments (1)
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/streaming/streaming_response.py:511
- This placement is bypassed by
send_stream_timed_out_notification(), which sends_create_stream_stopped_message()through_send_activityrather than_create_final_message(). Before this refactor_send_activityadded the AI entity whenever the flag was enabled, so timeout/stop terminal activities now lose the Generated-by-AI label. Apply the same metadata construction to that terminal-message path (ideally via a shared helper) and cover it with a test.
if self._enable_generated_by_ai_label:
curr_citations = CitationUtil.get_used_citations(
self._message, self._citations
)
activity.add_ai_metadata(curr_citations, self._sensitivity_label)
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Cecilia Avila (ceciliaavila)
requested a review
from Rodrigo Brandão (rodrigobr-msft)
September 18, 2026 13:56
Rodrigo Brandão (rodrigobr-msft)
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #587
Description
This pull request improves how AI-generated metadata and Teams feedback-loop information are emitted in streaming activities, ensuring that metadata is correctly placed and always present when needed. The changes also include new tests to verify these behaviors, and some code cleanup and refactoring.
Streaming metadata and Teams feedback-loop emission:
channelDataproperty of the final streaming activity, rather than in theStreamInfoentity. This ensures Teams clients receive feedback-loop information in the correct location. [1] [2] [3] [4]Testing improvements:
channelData, and that the AI-generated label is present even without citations. [1] [2] [3]channelDatais preserved when adding feedback-loop information, and that non-Teams channels do not receive this metadata.Code maintenance:
channelDatatypes. [1] [2] [3]Testing
These images show the feedback buttons and AI-generated label properly shown after the changes.
