Agent Apps Docs

Backpressure

Capacity limits, backpressure handling, and the CONTROLLER_AT_CAPACITY error.

Backpressure

The Controller enforces capacity limits to prevent overload.

Limits

LimitDefaultDescription
maxInflightPerSession32Max concurrent tool calls per session
maxInstances10Max concurrent instances
openTimeoutMs60000 (60s)Timeout for opening an instance

When limits are exceeded

When a limit is exceeded, the Controller returns a CONTROLLER_AT_CAPACITY error. This is a retryable error — the caller should back off and retry.

Best practices

  • Set maxInstances based on your machine's resources
  • Set maxInflightPerSession based on your app's concurrency model
  • Monitor CONTROLLER_AT_CAPACITY errors to know when to scale
  • Use cluster mode or ShardRouterRuntime to scale horizontally

Next steps