Skip to main content

Agent Loop

An agent loop is the end-to-end path from an inbound message to a final reply and/or actions. The gateway is responsible for keeping loop execution consistent and auditable.

Loop stages

Serialization guarantee

  • Runs are serialized per session key (and lane) to prevent tool and transcript races.
  • This keeps session history consistent and makes replay/audit more reliable.

Entry points

  • Gateway RPC: agent and agent.wait (or equivalent HTTP endpoints)
  • Channel ingress: a message mapped into a session enqueue