Skip to content

Conversation

@jviau
Copy link
Member

@jviau jviau commented Dec 10, 2025

Motivation and Context

Resolves #2327

Description

Durable agent framework pipeline was taking a dependency on the precise way the durable worker extension bootstrapped an entity invocation. With a recent change to the durable extension this no longer worked as that bootstrapping was deferred. This PR reduces that dependency by removing usage of TaskEntityDispatcher (which is no longer setup by the time this executor runs) and instead uses GrpcEntityRunner. TaskEntityDispatcher is just a wrapper around GrpcEntityRunner anyways.

Another reason reducing these bootstrapping dependencies is important is that it is inherently fragile. It requires the durable functions worker middleware run first, but there is nothing guaranteeing the middleware order between the extensions today. It works right now because durable tends to be configured from source gen auto-start hooks, but that is not set in stone that it will always work that way. For long term stability it will be better to decouple the durable agent's invocations from these implementation details of the durable function worker extension.

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 10, 2025 18:22
@github-actions github-actions bot changed the title Use GrpcEntityRunner instead of TaskEntityDispatcher .NET: Use GrpcEntityRunner instead of TaskEntityDispatcher Dec 10, 2025
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 durable agent framework to use GrpcEntityRunner directly instead of TaskEntityDispatcher, addressing a compatibility issue with recent changes to the durable worker extension where TaskEntityDispatcher is no longer initialized by the time the agent executor runs.

Key Changes:

  • Replaced TaskEntityDispatcher parameter with string parameter in entity invocation methods
  • Updated implementation to call GrpcEntityRunner.LoadAndRunAsync directly
  • Reordered parameters for consistency with other methods in the codebase

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctions.cs Changed InvokeAgentAsync method signature to accept string instead of TaskEntityDispatcher, removed async keyword, and updated implementation to use GrpcEntityRunner.LoadAndRunAsync directly
dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctionExecutor.cs Updated variable type from TaskEntityDispatcher to string, changed type matching in switch statement, and updated call site to match new parameter order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants