-
Notifications
You must be signed in to change notification settings - Fork 728
.NET: Add orchestration ID to durable agent entity state #2137
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
base: main
Are you sure you want to change the base?
.NET: Add orchestration ID to durable agent entity state #2137
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 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
OrchestrationIdproperty 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 |
dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/State/DurableAgentStateRequestTests.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/AgentEntityTests.cs
Outdated
Show resolved
Hide resolved
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
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
a625097 to
00bc248
Compare
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