Skip to content

Conversation

@moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Jan 9, 2026

Motivation and Context

Currently while running a workflow as an agent, when AgentRunUpdateEvents are produced, we are not specifying the agent's author_name or source_executor_id, which makes it difficult to know which event is tied to which agent.

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 self-assigned this Jan 9, 2026
Copilot AI review requested due to automatic review settings January 9, 2026 01:38
@moonbox3 moonbox3 added python workflows Related to Workflows in agent-framework labels Jan 9, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 9, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _agent.py2704384%61, 69–75, 103–104, 260, 316, 330, 343, 392–395, 401, 407, 411–412, 415–421, 425–426, 477, 484, 490–491, 497, 509, 541, 548, 569, 576, 580, 591
TOTAL17623288683% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2617 154 💤 0 ❌ 0 🔥 1m 0s ⏱️

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 PR addresses issue #1331 by ensuring that agent responses in multi-agent workflows include identification of which agent produced them. The implementation enriches AgentRunUpdateEvent objects with the executor's ID as the author_name when it's not already set.

Key Changes

  • Added logic to set author_name from executor_id in AgentRunUpdateEvent handling when author_name is not already present
  • Added comprehensive test coverage with three test cases covering different scenarios
  • Preserves existing author_name values when already set

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/packages/core/agent_framework/_workflows/_agent.py Added 3 lines to enrich AgentRunResponseUpdate with executor_id as author_name when not set
python/packages/core/tests/workflow/test_workflow_agent.py Added new test class TestWorkflowAgentAuthorName with 3 test methods covering various scenarios for author_name enrichment

@moonbox3 moonbox3 enabled auto-merge January 9, 2026 08:22
@moonbox3 moonbox3 added this pull request to the merge queue Jan 9, 2026
Merged via the queue into microsoft:main with commit d28ad2d Jan 9, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python workflows Related to Workflows in agent-framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Python: would it possible to include agent ID and name in response payload when using as_agent()

4 participants