Skip to content

Conversation

@philliphoff
Copy link
Member

@philliphoff philliphoff commented Nov 12, 2025

Description

Updates durable agent calls made within the context of an orchestration so that the orchestration ID gets propagated to the agent's underlying entity state. This allows tools that analyze agent state (such as the DTS Dashboard) to correlate individual requests to an agent back to the orchestration from which the request was made. (Currently that correlation can be done only one way, from the orchestration to the agent, but not vice-versa.)

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 November 12, 2025 18:23
@github-actions github-actions bot changed the title Add orchestration ID to durable agent entity state .NET: Add orchestration ID to durable agent entity state Nov 12, 2025
Copilot finished reviewing on behalf of philliphoff November 12, 2025 18:27
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 adds orchestration ID tracking to durable agent entity state, enabling bidirectional correlation between orchestrations and agent requests. This allows tools like the DTS Dashboard to trace individual agent requests back to their originating orchestration.

  • Adds OrchestrationId property to capture the orchestration context when agents are invoked
  • Updates the durable agent state schema version to 1.1.0 to reflect the backward-compatible change
  • Includes comprehensive test coverage for both orchestration and non-orchestration scenarios

Reviewed Changes

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

Show a summary per file
File Description
schemas/durable-agent-entity-state.json Adds optional orchestrationId field to the agentRequest schema definition
dotnet/src/Microsoft.Agents.AI.DurableTask/RunRequest.cs Adds internal OrchestrationId property to track orchestration context
dotnet/src/Microsoft.Agents.AI.DurableTask/State/DurableAgentStateRequest.cs Adds OrchestrationId property and maps it from RunRequest during conversion
dotnet/src/Microsoft.Agents.AI.DurableTask/State/DurableAgentState.cs Bumps schema version from 1.0.0 to 1.1.0 for the new optional field
dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAIAgent.cs Sets OrchestrationId from the orchestration context when creating agent requests
dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/State/DurableAgentStateRequestTests.cs Adds unit test for serialization/deserialization of OrchestrationId
dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs Adds integration test validating OrchestrationId is set during orchestrations and null otherwise
dotnet/src/Microsoft.Agents.AI.DurableTask/Microsoft.Agents.AI.DurableTask.csproj Grants integration tests access to internal members via InternalsVisibleTo

Copilot AI review requested due to automatic review settings November 12, 2025 18:56
Copilot finished reviewing on behalf of philliphoff November 12, 2025 18:58
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

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

@philliphoff philliphoff changed the base branch from feature-azure-functions to main November 13, 2025 17:50
@philliphoff philliphoff requested a review from a team as a code owner November 13, 2025 17:50
@philliphoff philliphoff force-pushed the philliphoff-orchestration-id branch from a625097 to 00bc248 Compare November 13, 2025 18:02
@vrdmr vrdmr added the azure-functions Issues and PRs related to Azure Functions label Nov 13, 2025
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 .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants