Skip to content
Tracon

TraconOutputTruncatedException

Namespace Tracon · Assembly Tracon.Abstractions.dll

Thrown when the model stops at its output token limit before a structured (JSON) response is complete.

public sealed class TraconOutputTruncatedException : TraconException, ISerializable
Inheritance
object ← Exception ← TraconException ← TraconOutputTruncatedException
Implements
ISerializable
Inherited Members
TraconException.ErrorType, Exception.GetBaseException(), Exception.ToString(), Exception.GetType(), Exception.TargetSite, Exception.Message, Exception.Data, Exception.InnerException, Exception.HelpLink, Exception.Source, Exception.HResult, Exception.StackTrace, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The run fails with error type output_truncated, classified as RunErrorClass.OutputTruncated. A cut-off JSON document cannot be parsed, and asking the model again with the same limit cuts it off again, so no structured-response repair turn runs. Raise ModelBinding.MaxOutputTokens instead.

Detection lives in the same shared IChatClient decorator that detects a provider’s content filter, so every provider that reports ChatFinishReason.Length gets the same behaviour. A plain-text response cut off the same way does not throw this exception; its run records a RunEventCustomTypes.OutputTruncated event instead.

The message names the provider and the limit. It never carries the response text.

Creates a new error.

public TraconOutputTruncatedException()

Creates a new error.

public TraconOutputTruncatedException(string message)

message string

The error message. Must not carry the response text.

TraconOutputTruncatedException(string, Exception)

Section titled “ TraconOutputTruncatedException(string, Exception)”

Creates a new error.

public TraconOutputTruncatedException(string message, Exception innerException)

message string

The error message. Must not carry the response text.

innerException Exception

The underlying error.

The stable value written to TraconException.ErrorType.

public const string OutputTruncatedErrorType = "output_truncated"

string

Gets the stable error type name written to the run record.

public override string ErrorType { get; }

string

Defaults to the full name of the exception type, so today’s behaviour does not change. A derived type overrides this member when the record has to be machine readable — for example TraconContentFilteredException writes content_filtered. Reports and alert rules can rely on this stable name instead of an assembly name.

The value is written to RunError.Type and carries no secret.

Gets the output token limit the request set, or null when the binding set none and the provider applied its own default.

public int? MaxOutputTokens { get; init; }

int?

Gets the provider whose model stopped at the limit, or null when unknown.

public string? ProviderName { get; init; }

string?