Ask a service-desk agent which of last week's P1 (priority-one) incidents are still open, and you have made one request. The model has not seen one request. Before the answer appears it has received at least two separate calls, and each one carried the whole conversation from the first word, because the model kept none of it between them.

Thesis: One request from you is a loop of turns, and each turn is one model call plus the tools that call asks for. The model is stateless, so the instructions, the tool definitions and the full history are in its input on every call, whoever stores them, and the harness, not the model, ends the loop: after a response that says the model has finished, or sooner, when a limit runs out, a call fails or the user stops it.

TLDRFour steps, about thirty seconds
one requestThe harnessThe modelat least two separate callssystem prompttool definitionsyour questionsystem prompttool definitionsyour questiontool requestthe tool resultCall 1Call 2tool_useend_turnThe modelstop reasonThe harnessa different stopsystem prompttoolsfull historyServer-side statePrompt cachingthe model's inputone requestThe harnessThe modelat least twoseparate callssystem prompttool definitionsyour questionsystem prompttool definitionsyour questiontool requestthe tool resultCall 1Call 2tool_useend_turnThe modelstop reasonThe harnessa different stopsystem prompttoolsfull historyServer-side statePrompt cachingthe model's input

Step 1 of 4

Anatomy of a Turn

You ask an agent which P1 incidents are still open: one request.

A question like this reaches the model as at least two calls, each carrying the whole conversation again, because the model keeps nothing between them.

Read the TLDR as text
  1. Anatomy of a Turn. You ask an agent which P1 incidents are still open: one request. A question like this reaches the model as at least two calls, each carrying the whole conversation again, because the model keeps nothing between them.
  2. Three Words, Three Parties, Five Parts. Whatever enters the model's input on one call is sent again on every later call, until something deliberately takes it out.
  3. A Turn Ends on a Stop Reason. The stop reason ends the model's own answer. Deciding when the task ends is a different stop, and the model must not own it.
  4. When the Abstraction Wins. Server-side state changes who stores the history and caching makes resending it cheaper; the model still reads all of it on every call.

The Agentic Lifecycle follows one request through an agent, from the prompt to the response; this first chapter is the loop that request runs in, seen call by call.

Three Words, Three Parties, Five Parts

Three words carry this whole series, and each names a different unit.

  • A request is what you ask for: one task, typed once, which may take the model several calls to finish.
  • A call is one trip to the model: one input sent, one response back.
  • A turn is one call plus the tool runs it triggers. A request lasts as many turns as the model needs.

When the model asks for a tool, this series calls that a tool request; the industry's "tool call", as in this series' last chapter title, means the same thing.

Every agent conversation also has three parties, and only two of them are visible in the chat window.

  • You, typing a message.
  • The model, which reads its input and writes a response. Nothing else. It runs on the servers of a provider, the company that serves it, such as Anthropic, OpenAI or Google.
  • The harness, the code that calls the model, runs the tools you define and decides whether to call it again; Model, Harness, Agent took it apart into five layers. In The Agent Is a While Loop this is the while. Here it is the part that assembles each call.

The input the harness builds for each call has five kinds of content, written by different hands.

Part Written by In the model's input
System prompt the team that built the agent on every call
Tool definitions the team that built the agent on every call
User messages you on every call after you type them
Assistant messages, including tool requests the model, on earlier calls on every call after they are generated
Tool results the harness, from your systems on every call after the tool runs

Once a part enters the model's input, it is in the input again on every later call until something deliberately takes it out.

Step Through One Conversation

The widget below follows one illustrative conversation with an IT service-desk agent that has a single tool, search_tickets. Step through it and watch the panel headed "what the model receives": it shows the contents of each call, with every part marked new or re-sent. The tickets are invented, and the figures are characters of this example's text, counted as you go, not tokens; how text becomes tokens has a chapter of its own. Two labels in the lab are field names from the provider's interface: a tool's output goes back to the model as a tool_result, and every response ends with a stop_reason saying why it stopped. With JavaScript off, a table shows the same three calls, and call 3 with the tool result dropped.

Call What it carries Ends with Characters
1 system prompt, tool definitions, your question tool_use: run the search 480
2 all of call 1, the model's tool request, the tool result end_turn: the answer 878
3 all of call 2, the answer, your follow-up end_turn: "Network Ops" 1,040
3, tool result dropped system prompt, tool definitions, your question, the answer, your follow-up tool_use: run the same search again, so a fourth call follows 642

You made two requests and read two answers. The model received three calls totalling 2,398 characters, and 57% of those characters had already been sent before. In the third answer the model names the ticket's owner without searching again. It seems to remember. It does not: the harness put the first search's raw result back into call 3. Leave that result out, as the toggle on the last step does, and the model has never seen it.


The Model Remembers Nothing

The harness reaches the model through the provider's API (application programming interface): the fixed format in which a program sends a call over the network and gets the response back, written in JSON, a plain-text format of named fields and lists. Each vendor encodes the five parts a little differently. None of them changes the fact underneath: the model is stateless. Anthropic's Messages API guide puts it in one line, that "you always send the full conversational history."

Some APIs will store the history for you, so your code sends only the new message. The history is still in the model's input on every call, and still billed as input. Who resends it varies by API; that the model reads all of it, every time, does not.

For builders: the wire format and server-side history, by vendor (as of November 2026)
  • Wire format. Anthropic's Messages API takes the system prompt and tools as top-level fields and returns a tool's output inside a user message as a tool_result block; OpenAI's Responses API sends it as a function_call_output item. Same round trip, different shapes. See Anthropic's tool definitions and OpenAI's function calling.
  • OpenAI server-side state. Chain responses with previous_response_id, or keep a Conversations object. The earlier input tokens are still billed, and a previous response's instructions do not carry over, so tools and instructions are sent on each call. See the conversation-state guide.
  • Anthropic message threads (beta). The API keeps the conversation, including the system prompt and tools, so later calls send only the new messages. See message threads.

Three consequences follow, whichever side does the resending.

Cost and latency scale with the history, not with the new message. Call 3 above exists to deliver an 18-character question and carries 1,040 characters to do it. Every call pays for the system prompt and every tool definition again. Give the agent forty tools and let one request take twelve calls, and those forty definitions are in the model's input twelve times before anyone sees an answer.

A tool result is not read once. The ticket data in call 2 rides along in every later call of the conversation. If a tool returns customer records or an employee's details, that data now sits in every later call until the harness drops it. Data minimization for an agent is a question about what each tool returns, because whatever it returns is re-sent.

The transcript the model sees is whatever your code sends. The same Anthropic page notes that earlier messages need not have come from the model at all. Harnesses use that to trim, summarize or rewrite history, and that is often the right call. It also means the chat log a user sees is not the record of what the model was told. For an audit, the record is what the model received: the call as sent when your code sends the history, or the stored conversation when the provider keeps it.

A Turn Ends on a Stop Reason

If one request can mean several calls, something has to decide when to call again. It is a field in each response, the stop reason. Three values run the loop:

  • tool_use: the model is asking for a tool. The harness runs it, appends the result and calls again. The request is paused, not finished.
  • end_turn: the model finished its answer. Show it.
  • max_tokens: the response hit the length limit you set. You have a cut-off answer, and a harness that treats any response as the end will show it as if it were complete.
flowchart TD
  A[Your message] --> B[Harness sends the call<br/>system prompt, tools, full history]
  B --> C[Model writes a response]
  C --> D{stop_reason?}
  D -->|tool_use| E[Harness runs the tool<br/>and appends the result]
  E --> B
  D -->|end_turn| F[Show the answer<br/>the request is done]
  D -->|max_tokens| G[A cut-off reply<br/>not a finished answer]
  style C fill:#5a5a8a

Figure: The harness's loop over stop reasons. Each call carries the system prompt, the tools and the full history; tool_use sends the harness to run the tool and call again, end_turn finishes the request, and max_tokens means a cut-off reply, not a finished answer.

Each pass around that loop is one turn: a call, and the tool run it asked for. The harness keeps calling for as long as the model asks for tools. Calling again is always the harness's choice, so it can also end the loop sooner: when a limit you set runs out, when a call fails and it does not retry, or when the user stops the run. Anthropic's stop-reason guide puts that choice in your code: read the field, then use the response, continue, retry or fall back.

For builders: the other stop reasons (Anthropic's list, as of November 2026)

Anthropic's stop-reason reference lists seven values; each needs a branch.

  • pause_turn: a tool loop the provider runs hit its iteration limit; send the assistant content back to continue.
  • stop_sequence: one of your stop strings fired.
  • refusal: not an answer. Read stop_details, then retry on a fallback model where your policy allows.
  • model_context_window_exceeded: the window is full; treat the response as truncated.

The model decides, through that field, when its own answering ends; it must not decide when the task ends. That is a different stop with a different owner; Loop on the Gap, Not the Try-Count covers that outer stop.

When the Abstraction Wins

The strongest objection is that this is plumbing. SDKs (software development kits, libraries that build the calls in your programming language) ship tool runners that run the loop for you. Some APIs keep the conversation on the server. Prompt caching, billing a repeated start of the call at a lower rate, makes the repeated part cheap. Why should a builder think in calls at all?

For a prototype, a short chat or an agent with small tool results, they should not. Use the runner and spend the time on the task. It stops serving you when you need to debug, budget or audit, because each of those starts from what the model actually received.

Server-side state changes who stores the history, not what is in the model's input or what you are billed for. Caching changes the price, not the presence: the cached text is still in the model's input and still fills the context window, the most the model can take in one call; What a Prompt Cache Reuses shows what a cache can and cannot reuse. Neither feature makes the model remember. Both make it cheaper to remind it.


What to Do Next

  • Log one full call, not the chat transcript. Take the largest call your agent sent yesterday, split it into the five parts above, and note which part is biggest.
  • Count calls per request. Record stop_reason on every response. Calls per request is your real unit of cost and latency, and it moves when someone adds a tool.
  • Find your heaviest tool result and ask how long it rides. If it carries records nobody needs after the next step, return less or have the harness drop it once it has been used.
  • Make every stop branch explicit. Loop on tool_use, stop on end_turn, and treat max_tokens as not done; the builders' list above covers the rest.
  • Decide what your audit record is. If compliance asks what the agent was told, the answer is what the model received: the call as sent, or the stored conversation if the provider keeps it. Keep it, with the same retention rules as the data inside it.

Next in the series: What Training Puts in the Weights, on where the model that reads each call came from. Related reading: The Agent Is a While Loop for the outer loop this chapter sits inside, What Compaction Actually Destroys for what to do when the re-sent history grows too long, and Your Tool Schemas Are the Bloat for the cost of the tool definitions that ride along on every call.