Skip to content

AgentRunBudgets

Defined in: packages/engine/src/lib/agent-session/agent-run.ts:26

Caps on one Agent Run. A run that reaches any cap stops with BUDGET_CLOSING_MESSAGE and a budget AgentRunFinished. The values are frozen for the run and never reach a prompt or tool arguments. A zero or NaN cap refuses the run before any model call.

The agent loop is experimental in 0.3 and may change in any minor release.

readonly maxElapsedMs: number

Defined in: packages/engine/src/lib/agent-session/agent-run.ts:30

Longest wall-clock duration of the run, in milliseconds, measured on AgentRunClock.


readonly maxTokens: number

Defined in: packages/engine/src/lib/agent-session/agent-run.ts:36

Most input plus output tokens the run may spend, summed over every provider call. Infinity disables the cap, so unknown usage no longer blocks tools.


readonly maxToolCalls: number

Defined in: packages/engine/src/lib/agent-session/agent-run.ts:38

Most tool calls the run may make across all turns.


readonly maxTurns: number

Defined in: packages/engine/src/lib/agent-session/agent-run.ts:28

Most model turns the run may take.