Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/RunStatus.cs
T
Jacob Alber 7ebe00ec3d [BREAKING] .NET: Workflow Off-Thread Execution Mode (#1233)
* Updates to async run loop.

* fix: Workflow Onwership can be release by nonowner

* fix: Incorrect handling of blockOnPending in StreamingRun

Depending on whether we are running in streaming on non-streaming mode, we may be using the StreamingRun in different ways. Unfortunately, the only place we can really know what is the actual state of execution is in the RunEventStream implementations.

This resulted in blocking where blocking was unneeded and occasionally not-blocking when blocking was needed.

The fix is to move the logic of handling this blocking into RunEventStream implementations.

* fix: Fix cleanup on error and end run

This ensures we clean up the background resources correctly.

* fix: Ensure we let the run loop proceed when shutting down

* fix: Add timeout for Input Waiting

* fix: Make the samples properly clean up `Run`s and `StreamingRun`s

* fix: Simplify Declarative Workflow Run disposal pattern

* Also fixes missing .Disposal() in Integration tests

---------

Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
2025-10-07 01:07:38 +00:00

35 lines
947 B
C#

// Copyright (c) Microsoft. All rights reserved.
namespace Microsoft.Agents.AI.Workflows;
/// <summary>
/// Specifies the current operational state of a workflow run.
/// </summary>
public enum RunStatus
{
/// <summary>
/// The run has not yet started. This only occurs when running in "lockstep" mode.
/// </summary>
NotStarted,
/// <summary>
/// The run has halted, has no outstanding requets, but has not received a <see cref="RequestHaltEvent"/>.
/// </summary>
Idle,
/// <summary>
/// The run has halted, and has at least one outstanding <see cref="ExternalRequest"/>.
/// </summary>
PendingRequests,
/// <summary>
/// The user has ended the run. No further events will be emitted, and no messages can be sent to it.
/// </summary>
Ended,
/// <summary>
/// The workflow is currently running, and may receive events or requests.
/// </summary>
Running
}