Skip to content

Conversation

@philliphoff
Copy link
Member

Motivation and Context

Currently, the durable agent entities use an entity method name to invoke the agent that is specific to each supported platform (e.g. RunAgentAsync on .NET but run_agent on Python). This makes it difficult for external tools (such as the Durable Task Scheduler Dashboard) to interact with durable agents in a platform agnostic manner.

This change updates the Python durable agent infrastructure to use a new, more general run method name. The existing run_agent method will still be available to accommodate older MAF clients and any pending entity signals, but considered deprecated. After a reasonable time, the run_agent method will be removed.

Resolves (for Python) #2234. A corresponding change is being made for .NET (#2843).

Description

Adds a new run method to the AgentEntity that performs the same logic as the existing run_agent method. The run_agent method then just delegates to the new method (in preparation for it being removed in the future).

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 December 15, 2025 22:45
@philliphoff philliphoff requested a review from a team as a code owner December 15, 2025 22:45
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Dec 15, 2025
@philliphoff philliphoff changed the title Philliphoff python agent entity method Python: Switch to new "run" method name. Dec 15, 2025
@github-actions github-actions bot changed the title Python: Switch to new "run" method name. Python: Philliphoff python agent entity method Dec 15, 2025
@philliphoff philliphoff changed the title Python: Philliphoff python agent entity method Python: Switch to new "run" method name. Dec 15, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Dec 15, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _app.py3748078%197–198, 203–204, 422, 430–431, 451–453, 459–461, 467–469, 502–503, 563–564, 699, 702, 711–713, 715–717, 719, 721, 732, 734–737, 739, 741–742, 744, 751–752, 754–755, 757–758, 760, 764, 774–776, 778–779, 781–783, 790, 792–793, 795, 816, 821, 833, 909, 921, 928–930, 975, 989, 1000–1002, 1004–1007, 1032, 1039, 1041, 1044
   _entities.py1812188%137, 177–178, 229, 237, 242–243, 270–271, 280, 287, 298, 304–305, 324–325, 395, 427–429, 431
   _orchestration.py1121289%109–110, 114, 354, 359–366
TOTAL16709263784% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2465 148 💤 0 ❌ 0 🔥 59.241s ⏱️

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 updates the Python durable agent infrastructure to use a new, more general run method name for entity operations, aligning with the .NET implementation for platform-agnostic tooling. The existing run_agent method is maintained for backward compatibility with older clients.

Key Changes

  • Adds a new run() method to AgentEntity that contains the agent execution logic
  • Updates run_agent() to delegate to the new run() method (preparing for future deprecation)
  • Updates all entity operation calls to use "run" instead of "run_agent"

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/packages/azurefunctions/agent_framework_azurefunctions/_entities.py Adds new run() method and updates run_agent() to delegate to it; updates operation dispatcher and logging
python/packages/azurefunctions/agent_framework_azurefunctions/_orchestration.py Updates entity call to use "run" operation name
python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Updates signal_entity calls to use "run" operation and updates documentation
python/packages/azurefunctions/tests/test_entities.py Updates tests to call the new run() method and adds test coverage for the new method
python/packages/azurefunctions/tests/test_orchestration.py Updates test assertion to expect "run" operation name
python/packages/azurefunctions/tests/test_app.py Updates tests to use "run" operation and adds new test for the operation
python/packages/azurefunctions/tests/integration_tests/README.md Adds environment variable configuration for DTS emulator

@cgillum cgillum added the azure-functions Issues and PRs related to Azure Functions label Dec 15, 2025
@philliphoff philliphoff added this pull request to the merge queue Dec 16, 2025
Merged via the queue into microsoft:main with commit 2bde58f Dec 16, 2025
24 checks passed
@philliphoff philliphoff deleted the philliphoff-python-agent-entity-method branch December 17, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-functions Issues and PRs related to Azure Functions documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants