Class SuspendedRun
- Namespace
- Emissary
- Assembly
- Emissary.dll
A durably suspended agent run, paused at a human-in-the-loop gate. Serialize with ToJson(), persist (e.g. via IAgentStateStore), and resume later — minutes or days — with ResumeAsync(SuspendedRun, bool, CancellationToken).
public sealed record SuspendedRun : IEquatable<SuspendedRun>
- Inheritance
-
SuspendedRun
- Implements
- Inherited Members
Constructors
SuspendedRun(Guid, IReadOnlyList<Message>, AgentUsage, IReadOnlyList<ToolResultBlock>, IReadOnlyList<PlannedEffect>, GuardSnapshot, IReadOnlyList<PlannedEffect>)
A durably suspended agent run, paused at a human-in-the-loop gate. Serialize with ToJson(), persist (e.g. via IAgentStateStore), and resume later — minutes or days — with ResumeAsync(SuspendedRun, bool, CancellationToken).
public SuspendedRun(Guid ConversationId, IReadOnlyList<Message> Messages, AgentUsage Usage, IReadOnlyList<ToolResultBlock> CompletedResults, IReadOnlyList<PlannedEffect> PendingApprovals, GuardSnapshot Guard, IReadOnlyList<PlannedEffect> PlannedEffects)
Parameters
ConversationIdGuidThe conversation's id.
MessagesIReadOnlyList<Message>The conversation so far, ending with the assistant's tool-use turn.
UsageAgentUsageUsage accumulated before suspension.
CompletedResultsIReadOnlyList<ToolResultBlock>Results of the batch's non-gated calls, already executed.
PendingApprovalsIReadOnlyList<PlannedEffect>The gated calls awaiting a decision.
GuardGuardSnapshotThe tool-call guard state.
PlannedEffectsIReadOnlyList<PlannedEffect>Shadow-planned effects accumulated before suspension.
Properties
CompletedResults
Results of the batch's non-gated calls, already executed.
public IReadOnlyList<ToolResultBlock> CompletedResults { get; init; }
Property Value
ConversationId
The conversation's id.
public Guid ConversationId { get; init; }
Property Value
Guard
The tool-call guard state.
public GuardSnapshot Guard { get; init; }
Property Value
Messages
The conversation so far, ending with the assistant's tool-use turn.
public IReadOnlyList<Message> Messages { get; init; }
Property Value
PendingApprovals
The gated calls awaiting a decision.
public IReadOnlyList<PlannedEffect> PendingApprovals { get; init; }
Property Value
PlannedEffects
Shadow-planned effects accumulated before suspension.
public IReadOnlyList<PlannedEffect> PlannedEffects { get; init; }
Property Value
Usage
Usage accumulated before suspension.
public AgentUsage Usage { get; init; }
Property Value
Methods
FromJson(string)
Deserializes a suspended run from JSON.
public static SuspendedRun FromJson(string json)
Parameters
jsonstringThe suspended-run JSON.
Returns
Exceptions
- InvalidOperationException
The JSON is the null literal.
ToJson()
Serializes the suspended run as indented JSON.
public string ToJson()