Interface: ResourceControls
Defined in: packages/agentos/src/api/types.ts:605
Resource limits applied to the entire agency run.
The onLimitReached policy determines whether a breach is fatal.
Properties
maxAgentCalls?
optionalmaxAgentCalls:number
Defined in: packages/agentos/src/api/types.ts:621
Maximum number of agent invocations (across all agents).
maxCostUSD?
optionalmaxCostUSD:number
Defined in: packages/agentos/src/api/types.ts:613
Maximum USD cost cap across the entire run.
maxDurationMs?
optionalmaxDurationMs:number
Defined in: packages/agentos/src/api/types.ts:619
Wall-clock time budget for the run in milliseconds. The lightweight
agent() helper maps this to a per-call request timeout
(requestTimeout) instead of the whole-run budget.
maxEmergentAgents?
optionalmaxEmergentAgents:number
Defined in: packages/agentos/src/api/types.ts:625
Maximum number of emergent agents the orchestrator may synthesise.
maxStepsPerAgent?
optionalmaxStepsPerAgent:number
Defined in: packages/agentos/src/api/types.ts:623
Maximum steps per individual agent invocation.
maxTotalTokens?
optionalmaxTotalTokens:number
Defined in: packages/agentos/src/api/types.ts:611
Maximum total tokens (prompt + completion) across all agents and steps.
The lightweight agent() helper maps this to a per-call completion-token
cap (maxTokens) instead of the run total.
maxValidationRetries?
optionalmaxValidationRetries:number
Defined in: packages/agentos/src/api/types.ts:637
Maximum number of retries when structured output validation fails.
When agent({ output: someZodSchema }) is set and the LLM returns text
that does not parse or validate against the schema, the agency will
retry the generation up to this many times, each time appending an
error feedback hint to the prompt so the model can self-correct.
Defaults to 1 (one extra attempt = two total calls). Set to 0 to
disable retries entirely.
onLimitReached?
optionalonLimitReached:"error"|"warn"|"stop"
Defined in: packages/agentos/src/api/types.ts:644
Action taken when any resource limit is breached.
"stop"— gracefully stop and return partial results."warn"— emit alimitReachedevent and continue."error"— throw an error and halt immediately.