Skip to content

[#587] Feedback-Loop buttons and Generated-by-AI label not showing when ending a streaming - #592

Merged
Cecilia Avila (ceciliaavila) merged 4 commits into
mainfrom
southworks/fix/feedback-loop
Oct 9, 2026
Merged

Cecilia Avila (ceciliaavila) merged 4 commits into
mainfrom
southworks/fix/feedback-loop

Conversation

@ceciliaavila

Copy link
Copy Markdown
Contributor

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:

  • The feedback-loop metadata for Teams is now emitted in the channelData property of the final streaming activity, rather than in the StreamInfo entity. This ensures Teams clients receive feedback-loop information in the correct location. [1] [2] [3] [4]
  • The "AI-generated" label is now always emitted in the final message's entities, even if there are no citations, ensuring downstream consumers can reliably detect AI-generated content. [1] [2] [3] [4]

Testing improvements:

  • Added and updated tests to verify that feedback-loop information is only included in Teams messages, is placed in channelData, and that the AI-generated label is present even without citations. [1] [2] [3]
  • Added a test to ensure existing channelData is preserved when adding feedback-loop information, and that non-Teams channels do not receive this metadata.

Code maintenance:

  • Refactored how feedback-loop and AI-generated metadata are added, moving logic out of the streaming send path and into the final message construction, and improved handling of various channelData types. [1] [2] [3]

Testing

These images show the feedback buttons and AI-generated label properly shown after the changes.
image

Copilot AI lite review requested due to automatic review settings September 18, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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_activity rather than _create_final_message(). Before this refactor _send_activity added 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.

Copilot AI review requested due to automatic review settings September 18, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ceciliaavila
Cecilia Avila (ceciliaavila) merged commit 67b4f38 into main Oct 9, 2026
10 checks passed
@ceciliaavila
Cecilia Avila (ceciliaavila) deleted the southworks/fix/feedback-loop branch October 9, 2026 16:03
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.

Feedback-Loop buttons and Generated-by-AI label not showing when ending a streaming

3 participants