# SubAgentSettings

> 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.subagentsettings/
> Summary: SubAgentSettings: Determines how an agent calls the agents it may call, and how long it waits for them.

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

Determines how an agent calls the agents it may call, and how long it waits for them.

```csharp
public sealed record SubAgentSettings : IEquatable<SubAgentSettings>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.subagentsettings/">SubAgentSettings</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;SubAgentSettings&gt;</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.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>

## Examples

A router that hands work to a sub-agent that must answer within 10 seconds,
with a 20-second hard cutoff if it hangs:

```csharp
new AgentDefinition
{
    Name = "router",
    Model = new ModelBinding { Provider = "openai", Model = "gpt-5" },
    CallableAgents = ["researcher"],
    SubAgents = new SubAgentSettings
    {
        ChildDeadline = TimeSpan.FromSeconds(10),
        WaitTimeout = TimeSpan.FromSeconds(20),
    },
};
```

## Remarks

[SubAgentSettings.CallMode](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_CallMode) picks the surface the model sees: the Microsoft Agent Framework
background task tools ([SubAgentCallMode.Background](/api/tracon.subagentcallmode/), the default), or one tool
per callable agent ([SubAgentCallMode.Tool](/api/tracon.subagentcallmode/)). The wait limits below, the depth
limit, the tree budget and the refusal of a sub-agent that needs tool approval apply in
both modes. In [SubAgentCallMode.Tool](/api/tracon.subagentcallmode/) mode the agent tool does not go through
the tool registry: the tool authorization, approval rules and per-tool timeout of the
registry do not apply to the call itself, only to the tools the sub-agent runs.

The limit is enforced in two independent layers, the same pattern
`OnlineEvaluationOptions.JudgeTimeout` uses for a judge call:
[SubAgentSettings.ChildDeadline](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_ChildDeadline) is a **cooperative** cutoff — the
sub-agent's own cancellation token is canceled, and a sub-agent that reads
it genuinely stops and releases its resources. [SubAgentSettings.WaitTimeout](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_WaitTimeout) is
a **hard** cutoff for the one case the cooperative layer
cannot catch: a sub-agent that ignores cancellation. Past
[SubAgentSettings.WaitTimeout](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_WaitTimeout) the caller stops waiting; the sub-agent keeps
running in the background and its eventual result — success or failure —
is discarded without writing a further event, a metric, or producing an
unobserved exception.

When left [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), both fields fall back to
`TraconAgentGraphOptions.ChildDeadline` and
`TraconAgentGraphOptions.WaitTimeout`. An invalid combination
(zero, negative, or [SubAgentSettings.WaitTimeout](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_WaitTimeout) not greater than
[SubAgentSettings.ChildDeadline](/api/tracon.subagentsettings/#Tracon_SubAgentSettings_ChildDeadline)) is rejected while the agent is built, with
[TraconCompilationException](/api/tracon.traconcompilationexception/); it is not ignored silently.

## Constructors

### <a id="Tracon_SubAgentSettings__ctor"></a> SubAgentSettings\(\)

```csharp
public SubAgentSettings()
```

## Properties

### <a id="Tracon_SubAgentSettings_CallMode"></a> CallMode

Gets how the agent calls every agent in `CallableAgents`.
Defaults to `Background`.

```csharp
public SubAgentCallMode CallMode { get; init; }
```

#### Property Value

 [SubAgentCallMode](/api/tracon.subagentcallmode/)

#### Remarks

With [SubAgentCallMode.Tool](/api/tracon.subagentcallmode/), the tool of a callable agent is named after the
agent, with each run of characters other than letters and digits replaced by one underscore
(`support-agent` becomes `support_agent`). A name that equals another tool of
the agent, or that another callable agent also gets, fails validation and compilation.

### <a id="Tracon_SubAgentSettings_ChildDeadline"></a> ChildDeadline

Gets the deadline applied to a single sub-agent run (the cooperative layer).

```csharp
public TimeSpan? ChildDeadline { get; init; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)?

#### Remarks

Must be from one millisecond to about 49.7 days; any other value fails to compile.

### <a id="Tracon_SubAgentSettings_WaitTimeout"></a> WaitTimeout

Gets the hard wait cutoff handed to the framework (the hard-cutoff layer).
Must be greater than `ChildDeadline`.

```csharp
public TimeSpan? WaitTimeout { get; init; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)?

#### Remarks

Must be from one millisecond to about 49.7 days; any other value fails to compile.

## Methods

### <a id="Tracon_SubAgentSettings_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_SubAgentSettings_Equals_Tracon_SubAgentSettings_"></a> Equals\(SubAgentSettings?\)

```csharp
public bool Equals(SubAgentSettings? other)
```

#### Parameters

`other` [SubAgentSettings](/api/tracon.subagentsettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_SubAgentSettings_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_SubAgentSettings_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_SubAgentSettings_op_Equality_Tracon_SubAgentSettings_Tracon_SubAgentSettings_"></a> operator ==\(SubAgentSettings?, SubAgentSettings?\)

```csharp
public static bool operator ==(SubAgentSettings? left, SubAgentSettings? right)
```

#### Parameters

`left` [SubAgentSettings](/api/tracon.subagentsettings/)?

`right` [SubAgentSettings](/api/tracon.subagentsettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_SubAgentSettings_op_Inequality_Tracon_SubAgentSettings_Tracon_SubAgentSettings_"></a> operator \!=\(SubAgentSettings?, SubAgentSettings?\)

```csharp
public static bool operator !=(SubAgentSettings? left, SubAgentSettings? right)
```

#### Parameters

`left` [SubAgentSettings](/api/tracon.subagentsettings/)?

`right` [SubAgentSettings](/api/tracon.subagentsettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
