# TraconFinishReasons

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconfinishreasons/
> Summary: TraconFinishReasons: Finish reasons Tracon reads beyond the ones AI.ChatFinishReason defines.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Finish reasons Tracon reads beyond the ones `AI.ChatFinishReason` defines.

```csharp
public static class TraconFinishReasons
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconfinishreasons/">TraconFinishReasons</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

A model provider reports one of these on its `AI.ChatResponse` (or on the
last streamed `AI.ChatResponseUpdate`) the same way it reports
`ChatFinishReason.Length`. Tracon reads them in the same shared ring that
reads the standard reasons, so every provider that reports one gets the same
behaviour.

## Properties

### <a id="Tracon_TraconFinishReasons_ContextWindowExceeded"></a> ContextWindowExceeded

Gets the finish reason of an answer the model stopped because the conversation
and the answer filled its context window.

```csharp
public static ChatFinishReason ContextWindowExceeded { get; }
```

#### Property Value

 ChatFinishReason

#### Remarks

Tracon treats it as a cut-off answer, like `ChatFinishReason.Length`:
a structured (JSON) response fails its run with
[TraconOutputTruncatedException](/api/tracon.traconoutputtruncatedexception/) ([RunErrorClass.OutputTruncated](/api/tracon.runerrorclass/)),
and a plain-text answer completes with a
[RunEventCustomTypes.OutputTruncated](/api/tracon.runeventcustomtypes/#Tracon_RunEventCustomTypes_OutputTruncated) run event whose payload
`cause` is `context_window`.

It is a separate reason because the remedy is different. A larger
[ModelBinding.MaxOutputTokens](/api/tracon.modelbinding/#Tracon_ModelBinding_MaxOutputTokens) does not fit in a full window; a shorter
conversation (context compaction) or a model with a larger window does. The
error message and the event say so.

`Tracon.Anthropic` reports it for Anthropic's
`model_context_window_exceeded` stop reason.
