mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Adding support for events & shared state in durable workflows. * PR feedback fixes * PR feedback fixes. * Add YieldOutputAsync calls to 05_WorkflowEvents sample executors The integration test asserts that WorkflowOutputEvent is found in the stream, but the sample executors only used AddEventAsync for custom events and never called YieldOutputAsync. Since WorkflowOutputEvent is only emitted via explicit YieldOutputAsync calls, the assertion would fail. Added YieldOutputAsync to each executor to match the test expectation and demonstrate the API in the sample. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix deserialization to use shared serializer options. * PR feedback updates. * Sample cleanup * PR feedback fixes * Addressing PR review feedback for DurableStreamingWorkflowRun - Use -1 instead of 0 for taskId in TaskFailedException when task ID is not relevant. - Add [NotNullWhen(true)] to TryParseWorkflowResult out parameter following .NET TryXXX conventions. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23 lines
995 B
C#
23 lines
995 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
namespace Microsoft.Agents.AI.DurableTask.Workflows;
|
|
|
|
/// <summary>
|
|
/// Represents the custom status written by the orchestration for streaming consumption.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The Durable Task framework exposes <c>SerializedCustomStatus</c> on orchestration metadata,
|
|
/// which is the only orchestration state readable by external clients while the orchestration
|
|
/// is still running. The orchestrator writes this object via <c>SetCustomStatus</c> after each
|
|
/// superstep so that <see cref="DurableStreamingWorkflowRun"/> can poll for new events.
|
|
/// On orchestration completion the framework clears custom status, so events are also
|
|
/// embedded in the output via <see cref="DurableWorkflowResult"/>.
|
|
/// </remarks>
|
|
internal sealed class DurableWorkflowCustomStatus
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the serialized workflow events emitted so far.
|
|
/// </summary>
|
|
public List<string> Events { get; set; } = [];
|
|
}
|