-
Notifications
You must be signed in to change notification settings - Fork 911
.NET: Switch to new "Run" method name. #2843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET: Switch to new "Run" method name. #2843
Conversation
There was a problem hiding this 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 introduces a platform-agnostic method name "RunAgent" to replace the .NET-specific "RunAgentAsync" method name for invoking durable agent entities. This enables external tools like the Durable Task Scheduler Dashboard to interact with agents across different platforms (e.g., .NET and Python) in a consistent manner.
Key Changes
- Introduced new
RunAgentmethod as the primary entity operation name - Maintained backward compatibility by keeping
RunAgentAsyncas a wrapper that delegates toRunAgent - Updated all internal callers to use the new method name
- Added comprehensive integration tests to verify both method names work correctly
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI.DurableTask/AgentEntity.cs |
Added new RunAgent method and converted RunAgentAsync to a wrapper for backward compatibility |
dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgent.cs |
Updated entity call to use RunAgent instead of RunAgentAsync |
dotnet/src/Microsoft.Agents.AI.DurableTask/DefaultDurableAgentClient.cs |
Updated entity signal to use RunAgent instead of RunAgentAsync |
dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs |
Added parameterized test to verify both "RunAgent" and "RunAgentAsync" method names work correctly |
Note: According to the repository's coding guidelines for the Durable Task area (CodingGuidelineID: 1000002), this PR should include an entry in the CHANGELOG.md file under an "## [Unreleased]" heading. The CHANGELOG.md file was not modified in this PR.
|
@philliphoff one thing not mentioned in the PR description - what is the plan for Python? |
@cgillum I could give it a go (but would rather it be a separate PR)? |
|
@philliphoff sorry I should have been more clear. I'm not asking that we make the Python change in the same PR (though that would be nice). Rather, I'm trying to understand what kind of change we plan on making (now or later) in Python. In the PR description, you call out the name differences as being I originally assumed we'd want to go with a name that works with the conventions of both languages. For example, using |
@cgillum I suggested/chose the case-insensitive (I was actually surprised that the DF SDK doesn't allow overriding the entity method name via attribute; that would be a bit cleaner.) |
|
@philliphoff okay, that's basically what I wanted to confirm. I'd personally prefer |
|
The corresponding Python change is #2890. |
cgillum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can you also update the CHANGELOG.md file with this update? I was hoping Copilot would ask for this, but it seems to not be following the new instructions I added.
Added. |
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.
RunAgentAsyncon .NET butrun_agenton 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 .NET durable agent infrastructure to use a new, more general
Run(case-insensitive) method name. The existingRunAgentAsyncmethod will still be available to accommodate older MAF clients and any pending entity signals, but considered deprecated. After a reasonable time, theRunAgentAsyncmethod will be removed.Resolves (for .NET) #2234. A corresponding change will be needed for Python.
Description
Adds a new
Runmethod to theAgentEntitythat performs the same logic as the existingRunAgentAsyncmethod. TheRunAgentAsyncmethod then just delegates to the new method (in preparation for it being removed in the future).Contribution Checklist