Skip to content

HarnessContextCompactionCompletedEvent

NexusLabs.Foundry.MicrosoftAgentFramework

NexusLabs.Foundry.MicrosoftAgentFramework.Progress

HarnessContextCompactionCompletedEvent Class

One hybrid context compaction/assembly attempt completed successfully — Diagnostics's outcome is WithinLimit, Reduced, or PreservationFallback. Emitted at most once per assembly attempt that reached the started state, as one of exactly two mutually exclusive terminal events alongside HarnessContextCompactionTerminatedEvent — never both for the same attempt. Never emitted for an attempt whose classifier or snapshot-construction phase threw before the HarnessContextCompactionStartedEvent was emitted. Emitted immediately once the decision is known, before the outer execution-binding revalidation that precedes dispatch, so an already-successful compaction decision remains observable even if that later revalidation itself fails.

public sealed record HarnessContextCompactionCompletedEvent : NexusLabs.Foundry.MicrosoftAgentFramework.Progress.IProgressEvent, System.IEquatable<NexusLabs.Foundry.MicrosoftAgentFramework.Progress.HarnessContextCompactionCompletedEvent>

Inheritance System.Object 🡒 HarnessContextCompactionCompletedEvent

Implements IProgressEvent, System.IEquatable<HarnessContextCompactionCompletedEvent>

Constructors

HarnessContextCompactionCompletedEvent(DateTimeOffset, string, string, string, int, long, Guid, HarnessContextDiagnostics) Constructor

One hybrid context compaction/assembly attempt completed successfully — Diagnostics's outcome is WithinLimit, Reduced, or PreservationFallback. Emitted at most once per assembly attempt that reached the started state, as one of exactly two mutually exclusive terminal events alongside HarnessContextCompactionTerminatedEvent — never both for the same attempt. Never emitted for an attempt whose classifier or snapshot-construction phase threw before the HarnessContextCompactionStartedEvent was emitted. Emitted immediately once the decision is known, before the outer execution-binding revalidation that precedes dispatch, so an already-successful compaction decision remains observable even if that later revalidation itself fails.

public HarnessContextCompactionCompletedEvent(System.DateTimeOffset Timestamp, string WorkflowId, string? AgentId, string? ParentAgentId, int Depth, long SequenceNumber, System.Guid AssemblyId, NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextDiagnostics Diagnostics);

Parameters

Timestamp System.DateTimeOffset

When the decision was reached.

WorkflowId System.String

Top-level workflow correlation ID.

AgentId System.String

Which agent emitted this event, or null for workflow-level events.

ParentAgentId System.String

Parent agent ID for sub-agent runs, enabling tree reconstruction.

Depth System.Int32

Nesting depth: 0 = workflow, 1 = agent, 2 = sub-agent, etc.

SequenceNumber System.Int64

Globally ordered sequence number for event ordering.

AssemblyId System.Guid

The identical opaque per-assembly correlation ID carried by the preceding HarnessContextCompactionStartedEvent for this same attempt (and, subsequently, by HarnessContextComposedEvent), so this Completed event is pairable with its Started event even when other concurrently-running assemblies on the same agent interleave their own events' SequenceNumbers in between.

Diagnostics HarnessContextDiagnostics

The privacy-safe, structured evidence for this decision. The identical instance is also carried by HarnessContextComposedEvent when this same attempt subsequently reaches dispatch.

Properties

HarnessContextCompactionCompletedEvent.AgentId Property

Which agent emitted this event, or null for workflow-level events.

public string? AgentId { get; init; }

Implements AgentId

Property Value

System.String

HarnessContextCompactionCompletedEvent.AssemblyId Property

The identical opaque per-assembly correlation ID carried by the preceding HarnessContextCompactionStartedEvent for this same attempt (and, subsequently, by HarnessContextComposedEvent), so this Completed event is pairable with its Started event even when other concurrently-running assemblies on the same agent interleave their own events' SequenceNumbers in between.

public System.Guid AssemblyId { get; init; }

Property Value

System.Guid

HarnessContextCompactionCompletedEvent.Depth Property

Nesting depth: 0 = workflow, 1 = agent, 2 = sub-agent, etc.

public int Depth { get; init; }

Implements Depth

Property Value

System.Int32

HarnessContextCompactionCompletedEvent.Diagnostics Property

The privacy-safe, structured evidence for this decision. The identical instance is also carried by HarnessContextComposedEvent when this same attempt subsequently reaches dispatch.

public NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextDiagnostics Diagnostics { get; init; }

Property Value

HarnessContextDiagnostics

HarnessContextCompactionCompletedEvent.ParentAgentId Property

Parent agent ID for sub-agent runs, enabling tree reconstruction.

public string? ParentAgentId { get; init; }

Implements ParentAgentId

Property Value

System.String

HarnessContextCompactionCompletedEvent.SequenceNumber Property

Globally ordered sequence number for event ordering.

public long SequenceNumber { get; init; }

Implements SequenceNumber

Property Value

System.Int64

HarnessContextCompactionCompletedEvent.Timestamp Property

When the decision was reached.

public System.DateTimeOffset Timestamp { get; init; }

Implements Timestamp

Property Value

System.DateTimeOffset

HarnessContextCompactionCompletedEvent.WorkflowId Property

Top-level workflow correlation ID.

public string WorkflowId { get; init; }

Implements WorkflowId

Property Value

System.String