.NET API
LoopSettings
Tracon.Abstractions.dllTurns the harness loop on: the agent is re-invoked until a stop criterion says the work is finished.
public sealed record LoopSettings : IEquatable<LoopSettings>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
Section titled “Examples”An agent that keeps working until it writes ALL DONE, for at most
five iterations:
new AgentDefinition{ Name = "researcher", Model = new ModelBinding { Provider = "openai", Model = "gpt-5" }, Harness = new HarnessSettings { Loop = new LoopSettings { Criteria = [new LoopCriterion { Kind = "completionMarker", Marker = "ALL DONE" }], MaxIterations = 5, }, },};Remarks
Section titled “Remarks”The loop is off while HarnessSettings.Loop is
null, and the harness behaves exactly as it did before this
setting existed. Nothing turns it on implicitly.
This is not HarnessSettings.MaximumIterationsPerRequest.
The two numbers count different things and are deliberately kept in separate
types so they cannot be read as one:
| Setting | What it bounds |
|---|---|
| `HarnessSettings.MaximumIterationsPerRequest` | The harness's *inner* tool-calling loop inside ONE agent invocation. It is a runaway-safety ceiling, not a stop criterion. |
| `MaxIterations` | The *outer* loop that re-invokes the whole agent after a criterion says the work is not finished. It bounds how many times that may happen. |
Criteria are evaluated in order, and the first one that asks for
another iteration wins — the remaining criteria are not evaluated
that iteration. The loop therefore stops only when every criterion is
satisfied. Put the cheapest criterion first: an aiJudge placed after a
completionMarker costs nothing on the iterations the marker already
keeps going.
Every completed iteration writes a
RunEventType.LoopIterationCompleted event to the run, so the
loop is visible in the run record instead of hidden inside a caller’s own
code.
Constructors
Section titled “Constructors”LoopSettings()
Section titled “ LoopSettings()”public LoopSettings()Fields
Section titled “Fields”DefaultMaxIterations
Section titled “ DefaultMaxIterations”The iteration ceiling applied when MaxIterations is
null.
public const int DefaultMaxIterations = 10Field Value
Section titled “Field Value”Remarks
Section titled “Remarks”The ceiling is never left open. A criterion that can never be satisfied — a marker the model does not write, a judge that is never convinced — turns an open loop into a bill the consumer only learns about from an invoice, so Tracon applies its own ceiling instead of leaving the number to the framework’s default.
Properties
Section titled “Properties”Criteria
Section titled “ Criteria”Gets the stop criteria, evaluated in order. At least one is required.
public required IReadOnlyList<LoopCriterion> Criteria { get; init; }Property Value
Section titled “Property Value”FreshContextPerIteration
Section titled “ FreshContextPerIteration”Gets a value that starts every iteration from a fresh context instead of carrying the previous iterations’ messages forward.
public bool FreshContextPerIteration { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Off by default. Turning it on changes what the agent remembers between iterations: the agent no longer sees its own earlier answers, only the original request and the criterion’s feedback. Use it when repeated context is what makes the agent repeat itself; leave it off when the work builds on the previous iteration.
MaxIterations
Section titled “ MaxIterations”Gets the upper number of loop iterations. null takes
DefaultMaxIterations. Must be greater than zero.
public int? MaxIterations { get; init; }Property Value
Section titled “Property Value”int?
Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(LoopSettings?)
Section titled “ Equals(LoopSettings?)”public bool Equals(LoopSettings? other)Parameters
Section titled “Parameters”other LoopSettings?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(LoopSettings?, LoopSettings?)
Section titled “ operator ==(LoopSettings?, LoopSettings?)”public static bool operator ==(LoopSettings? left, LoopSettings? right)Parameters
Section titled “Parameters”left LoopSettings?
right LoopSettings?
Returns
Section titled “Returns”operator !=(LoopSettings?, LoopSettings?)
Section titled “ operator !=(LoopSettings?, LoopSettings?)”public static bool operator !=(LoopSettings? left, LoopSettings? right)Parameters
Section titled “Parameters”left LoopSettings?
right LoopSettings?