Skip to content

Python: Add context_providers and description to workflow.as_agent()#4651

Merged
moonbox3 merged 6 commits into
microsoft:mainfrom
cecheta:workflow
Apr 16, 2026
Merged

Python: Add context_providers and description to workflow.as_agent()#4651
moonbox3 merged 6 commits into
microsoft:mainfrom
cecheta:workflow

Conversation

@cecheta

@cecheta cecheta commented Mar 12, 2026

Copy link
Copy Markdown
Member

Motivation and Context

Closes #4650 #4652

Description

Allow passing more options to workflow.as_agent(), including context providers and description.
Agent name and description now default to the workflow's.

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.

Copilot AI review requested due to automatic review settings March 12, 2026 16:32
@markwallace-microsoft markwallace-microsoft added the python Usage: [Issues, PRs], Target: Python label Mar 12, 2026
@github-actions github-actions Bot changed the title Add context_providers and description to workflow.as_agent() Python: Add context_providers and description to workflow.as_agent() Mar 12, 2026
@markwallace-microsoft

markwallace-microsoft commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _workflow.py2801993%91, 270–272, 274–275, 293, 297, 444, 639, 660, 716, 728, 734, 739, 759–761, 812
TOTAL27670320088% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
5595 20 💤 0 ❌ 0 🔥 1m 31s ⏱️

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.

Pull request overview

Expands the Python Workflow.as_agent() convenience API to support more WorkflowAgent/BaseAgent configuration so callers don’t need to instantiate WorkflowAgent directly (addresses #4650).

Changes:

  • Extend Workflow.as_agent() to accept description, context_providers, and passthrough **kwargs to WorkflowAgent/BaseAgent.
  • Add a unit test ensuring description and context_providers are forwarded correctly.

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/_workflow.py Extends Workflow.as_agent() signature and forwards new options into WorkflowAgent.
python/packages/core/tests/workflow/test_workflow_agent.py Adds coverage for forwarding description and context_providers through Workflow.as_agent().

You can also share your feedback on Copilot code review. Take the survey.

Comment thread python/packages/core/agent_framework/_workflows/_workflow.py

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.

Pull request overview

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


You can also share your feedback on Copilot code review. Take the survey.

Comment thread python/packages/core/agent_framework/_workflows/_workflow.py Outdated
@markwallace-microsoft

Copy link
Copy Markdown
Contributor

@cecheta, friendly reminder — this issue is waiting on your response. Please share any updates when you get a chance. (This is an automated message.)

@cecheta

cecheta commented Mar 20, 2026

Copy link
Copy Markdown
Member Author

Pull request is awaiting review

@moonbox3 moonbox3 added this pull request to the merge queue Apr 14, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 14, 2026
@moonbox3 moonbox3 added this pull request to the merge queue Apr 15, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 15, 2026
@moonbox3 moonbox3 added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@moonbox3 moonbox3 enabled auto-merge April 16, 2026 01:42
@moonbox3 moonbox3 added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@moonbox3 moonbox3 added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@moonbox3 moonbox3 added this pull request to the merge queue Apr 16, 2026
Merged via the queue into microsoft:main with commit 6969706 Apr 16, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Provide context_provider and description when calling Workflow.as_agent()

6 participants