Skip to content

HarnessContextCompactionStartedEvent

NexusLabs.Foundry.MicrosoftAgentFramework

NexusLabs.Foundry.MicrosoftAgentFramework.Progress

HarnessContextCompactionStartedEvent Class

One hybrid context compaction/assembly attempt has started. Emitted exactly once per assembly attempt that reaches the assembly phase — after message adaptation, snapshot integration, and assembler construction have all succeeded, immediately before AssembleAsync is called — while an experimental HarnessHybridProfile is configured. Never emitted for a call made while compaction is absent, and never emitted when a classifier or snapshot-construction exception aborts before assembly begins. Carries no size observation yet, only the configured measurement unit and thresholds, because the original size is only known once the assembler captures its own snapshot.

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

Inheritance System.Object 🡒 HarnessContextCompactionStartedEvent

Implements IProgressEvent, System.IEquatable<HarnessContextCompactionStartedEvent>

Constructors

HarnessContextCompactionStartedEvent(DateTimeOffset, string, string, string, int, long, Guid, HarnessContextMeasurementUnit, int, int) Constructor

One hybrid context compaction/assembly attempt has started. Emitted exactly once per assembly attempt that reaches the assembly phase — after message adaptation, snapshot integration, and assembler construction have all succeeded, immediately before AssembleAsync is called — while an experimental HarnessHybridProfile is configured. Never emitted for a call made while compaction is absent, and never emitted when a classifier or snapshot-construction exception aborts before assembly begins. Carries no size observation yet, only the configured measurement unit and thresholds, because the original size is only known once the assembler captures its own snapshot.

public HarnessContextCompactionStartedEvent(System.DateTimeOffset Timestamp, string WorkflowId, string? AgentId, string? ParentAgentId, int Depth, long SequenceNumber, System.Guid AssemblyId, NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextMeasurementUnit MeasurementUnit, int HardLimit, int TriggerThreshold);

Parameters

Timestamp System.DateTimeOffset

When the assembly attempt started.

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

A privacy-safe, opaque per-assembly correlation ID generated exactly once for this attempt, immediately after message adaptation, snapshot integration, and assembler construction have all succeeded — the same instant this Started event is emitted — and threaded identically to whichever terminal event (HarnessContextCompactionCompletedEvent or HarnessContextCompactionTerminatedEvent) and, on success, the subsequent HarnessContextComposedEvent follow for this same attempt. Never reused across two different assembly attempts, even for the same agent within the same workflow, so two concurrently-running provider calls on the same agent remain pairable despite their SequenceNumbers being interleaved.

MeasurementUnit HarnessContextMeasurementUnit

The explicit unit every size on the eventual terminal event is expressed in.

HardLimit System.Int32

The hard limit in force for this assembly, in MeasurementUnit.

TriggerThreshold System.Int32

The trigger threshold (hard limit minus trigger margin) in force for this assembly, in MeasurementUnit.

Properties

HarnessContextCompactionStartedEvent.AgentId Property

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

public string? AgentId { get; init; }

Implements AgentId

Property Value

System.String

HarnessContextCompactionStartedEvent.AssemblyId Property

A privacy-safe, opaque per-assembly correlation ID generated exactly once for this attempt, immediately after message adaptation, snapshot integration, and assembler construction have all succeeded — the same instant this Started event is emitted — and threaded identically to whichever terminal event (HarnessContextCompactionCompletedEvent or HarnessContextCompactionTerminatedEvent) and, on success, the subsequent HarnessContextComposedEvent follow for this same attempt. Never reused across two different assembly attempts, even for the same agent within the same workflow, so two concurrently-running provider calls on the same agent remain pairable despite their SequenceNumbers being interleaved.

public System.Guid AssemblyId { get; init; }

Property Value

System.Guid

HarnessContextCompactionStartedEvent.Depth Property

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

public int Depth { get; init; }

Implements Depth

Property Value

System.Int32

HarnessContextCompactionStartedEvent.HardLimit Property

The hard limit in force for this assembly, in MeasurementUnit.

public int HardLimit { get; init; }

Property Value

System.Int32

HarnessContextCompactionStartedEvent.MeasurementUnit Property

The explicit unit every size on the eventual terminal event is expressed in.

public NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.HarnessContextMeasurementUnit MeasurementUnit { get; init; }

Property Value

HarnessContextMeasurementUnit

HarnessContextCompactionStartedEvent.ParentAgentId Property

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

public string? ParentAgentId { get; init; }

Implements ParentAgentId

Property Value

System.String

HarnessContextCompactionStartedEvent.SequenceNumber Property

Globally ordered sequence number for event ordering.

public long SequenceNumber { get; init; }

Implements SequenceNumber

Property Value

System.Int64

HarnessContextCompactionStartedEvent.Timestamp Property

When the assembly attempt started.

public System.DateTimeOffset Timestamp { get; init; }

Implements Timestamp

Property Value

System.DateTimeOffset

HarnessContextCompactionStartedEvent.TriggerThreshold Property

The trigger threshold (hard limit minus trigger margin) in force for this assembly, in MeasurementUnit.

public int TriggerThreshold { get; init; }

Property Value

System.Int32

HarnessContextCompactionStartedEvent.WorkflowId Property

Top-level workflow correlation ID.

public string WorkflowId { get; init; }

Implements WorkflowId

Property Value

System.String