Skip to content
Tracon

TraconAgentGraphOptions

Namespace Tracon · Assembly Tracon.Core.dll

Defines limits that apply when an agent calls another agent.

public sealed class TraconAgentGraphOptions

objectTraconAgentGraphOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Child-agent calls multiply cost because every layer makes its own model calls. Without limits, one incorrectly written definition can start dozens of runs for one request. Depth, token, and count limits therefore have defaults.

Limits apply per tree: the root run creates an AgentRunBudget, and every run in the tree shares it.

public TraconAgentGraphOptions()

Gets or sets the deadline applied to a single sub-agent call (the cooperative layer). Overridable per agent with SubAgentSettings.ChildDeadline.

public TimeSpan ChildDeadline { get; set; }

TimeSpan

Unlike TraconAgentGraphOptions.MaxDuration, this default intentionally exists and is non-zero, the same reasoning as TraconAgentGraphOptions.MaxDepth and TraconAgentGraphOptions.MaxTotalTokens: an unlimited installation learns about its first hanging sub-agent call from a stuck tree, not from a setting.

Gets or sets the largest allowed call depth. The root run has depth zero, so the default allows a three-layer tree.

public int MaxDepth { get; set; }

int

Gets or sets the wall-clock time the whole tree may take, counted from the root run’s start. Zero or a negative value removes the limit.

public TimeSpan MaxDuration { get; set; }

TimeSpan

Unlike the other three dimensions, this has no non-zero default: an eval run and a chat turn do not run on the same time scale, so there is no one duration every installation should be silently held to.

The cutoff always lands between two model turns; a tool call already in progress when the deadline passes is not interrupted and runs to completion. See AgentRunBudget.

Gets or sets the largest amount a tree can spend. Zero or a negative value removes the limit.

public decimal MaxTotalCost { get; set; }

decimal

Unlike TraconAgentGraphOptions.MaxTotalTokens, this has no default: pricing is not always known (PricingSource.Unknown), so a cost cap must be an explicit opt-in, not a value every installation is silently held to.

Gets or sets the largest number of child runs a tree can start. The root run does not count. Zero or a negative value removes the limit.

public int MaxTotalRuns { get; set; }

int

Gets or sets the largest token count that a tree can spend. Zero or a negative value removes the limit.

public long MaxTotalTokens { get; set; }

long

The default intentionally exists. An unlimited installation learns about its first invalid definition from the bill.

Gets or sets the hard wait cutoff for a sub-agent call that ignores cancellation (the hard-cutoff layer). Must be greater than TraconAgentGraphOptions.ChildDeadline; overridable per agent with SubAgentSettings.WaitTimeout.

public TimeSpan WaitTimeout { get; set; }

TimeSpan

When never set explicitly, this tracks TraconAgentGraphOptions.ChildDeadline plus a fixed 30-second pad — raising TraconAgentGraphOptions.ChildDeadline alone keeps the hard cutoff strictly after the cooperative one by construction, exactly the guarantee Tracon.TraconOptionsValidator checks. Setting this property pins it to that value instead. A TraconAgentGraphOptions.ChildDeadline within TraconAgentGraphOptions.WaitTimeoutPad of TimeSpan.MaxValue clamps the derived value to TimeSpan.MaxValue rather than overflowing — the same “an absurd duration behaves as practically unlimited, not a crash” convention AgentRunBudget uses for its own deadline.

Creates a tree budget from these options.

public AgentRunBudget CreateBudget(TimeProvider timeProvider)

timeProvider TimeProvider

The time source AgentRunBudget.Deadline is computed from.

AgentRunBudget

The budget that the root run shares through its tree.