# Run loop

> Tag 5: the client sends a prompt; the server opens the proxy’s /agent/run and relays the chunks of the loop as channel responses, an error last when there was no loop or it did not finish, and the channel response finish.

Canonical: https://provider.diverge.network/2.3.0/endpoints/containers-agents-run/client/run-loop/
Specification revision: 2.3.0

The client opens this channel to run one loop of the agent. The
server opens [`/agent/run`](/2.3.0/proxy/agent/run/) on the proxy with the
prompt and relays the loop.

- **The request.** The tag byte `5` followed by the prompt as JSON.
  [Request](/2.3.0/endpoints/containers-agents-run/client/run-loop/request/) states its form.
- **The response.** One channel response per chunk, an error last
  when the proxy sent one, and the channel response finish when the
  proxy closes. [Response](/2.3.0/endpoints/containers-agents-run/client/run-loop/response/)
  states the sequence.
- **One at a time.** The server opens `/agent/run` for every run-loop
  channel the client opens; a loop asked for while one runs is
  answered as the proxy answers it, with an error as the first
  channel response.
