Skip to content

StageTermination.Custom

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Diagnostics.StageTermination

StageTermination.Custom Class

Application-specific termination cause not covered by framework cases. Use this from an onLoopCompleted callback when a stage has app-specific semantics (e.g. "Reconciled — 7 outstanding issues").

public sealed record StageTermination.Custom : NexusLabs.Needlr.AgentFramework.Diagnostics.StageTermination, System.IEquatable<NexusLabs.Needlr.AgentFramework.Diagnostics.StageTermination.Custom>

Inheritance System.Object 🡒 StageTermination 🡒 Custom

Implements System.IEquatable<Custom>

Constructors

Custom(string, IReadOnlyDictionary<string,object>) Constructor

Application-specific termination cause not covered by framework cases. Use this from an onLoopCompleted callback when a stage has app-specific semantics (e.g. "Reconciled — 7 outstanding issues").

public Custom(string Reason, System.Collections.Generic.IReadOnlyDictionary<string,object?>? Properties=null);

Parameters

Reason System.String

Short, dashboard-friendly description. Used as the OpenTelemetry tag value via ToTagValue(), so consumers should keep the cardinality bounded (or normalise / bucket before constructing the case).

Properties System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>

Optional structured metadata for richer post-mortem queries. Values typed as System.Object for flexibility — note that JSON deserialization yields System.Text.Json.JsonElement values, not the original concrete types.

Properties

StageTermination.Custom.Properties Property

Optional structured metadata for richer post-mortem queries. Values typed as System.Object for flexibility — note that JSON deserialization yields System.Text.Json.JsonElement values, not the original concrete types.

public System.Collections.Generic.IReadOnlyDictionary<string,object?>? Properties { get; init; }

Property Value

System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>

StageTermination.Custom.Reason Property

Short, dashboard-friendly description. Used as the OpenTelemetry tag value via ToTagValue(), so consumers should keep the cardinality bounded (or normalise / bucket before constructing the case).

public string Reason { get; init; }

Property Value

System.String

Methods

StageTermination.Custom.ToTagValue() Method

Returns a stable, low-cardinality string suitable for OpenTelemetry tag values. Default implementation returns the case name (e.g. "MaxIterationsReached"). Custom overrides this to return its Reason field.

public override string ToTagValue();

Implements ToTagValue()

Returns

System.String