Skip to content

PendingApproval

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The pending tool approval request of a run that executes from the queue.

public sealed record PendingApproval : IEquatable<PendingApproval>

objectPendingApproval

IEquatable<PendingApproval>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This record is a projection, not the owner: the single source of truth is the session state of MAF (ToolApprovalRequestContent, which lives in the session history). While the decision is applied the session is read, not this table.

The run that owns the pending request closes with RunStatus.AwaitingApproval and never changes again. Once the decision is made the SAME run does not continue; a new run is put on the queue (the same PendingApproval.SessionId, a new RunId).

public PendingApproval()

Gets the arguments of the tool call as key=value pairs (reflection-based JSON serialization is not USED, to stay AOT compatible). It stays null when RecordToolPayloads is turned off in the recording settings.

public string? Arguments { get; init; }

string?

Gets the creation time.

public required DateTimeOffset CreatedAt { get; init; }

DateTimeOffset

Gets the time of the decision, or null when no decision was made.

public DateTimeOffset? DecidedAt { get; init; }

DateTimeOffset?

Gets the actor that made the decision, or null when no decision was made.

public string? DecidedBy { get; init; }

string?

Gets the time after which the request counts as ApprovalStatus.Expired.

public required DateTimeOffset ExpiresAt { get; init; }

DateTimeOffset

It is required: an approval request that waits forever is a leak.

Gets the record id.

public required Guid Id { get; init; }

Guid

Gets the ToolApprovalRequestContent.RequestId value produced by MAF.

public required string RequestId { get; init; }

string

Gets the run that produced this request and closed with RunStatus.AwaitingApproval.

public required Guid RunId { get; init; }

Guid

Gets the session of the run. While the decision is applied, the continuing run is put on the queue with this session.

public required string SessionId { get; init; }

string

Gets the status of the request.

public required ApprovalStatus Status { get; init; }

ApprovalStatus

Gets the tenant id.

public required string TenantId { get; init; }

string

Gets the name of the tool that asks for approval.

public required string ToolName { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(PendingApproval? other)

other PendingApproval?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(PendingApproval?, PendingApproval?)

Section titled “ operator ==(PendingApproval?, PendingApproval?)”
public static bool operator ==(PendingApproval? left, PendingApproval? right)

left PendingApproval?

right PendingApproval?

bool

operator !=(PendingApproval?, PendingApproval?)

Section titled “ operator !=(PendingApproval?, PendingApproval?)”
public static bool operator !=(PendingApproval? left, PendingApproval? right)

left PendingApproval?

right PendingApproval?

bool