Agents and AutomationLesson 12 of 72

Module 2 · The machinery: transcript, tools, loop

What the model actually sees each turn

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 3 of 11 in this chapter

This chapter’s goalTrace any agent run from its message list (tool definitions going in, tool results coming back) and explain from the transcript alone why the model chose each step.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
What your harness sends on every single stepsystemThe instructionblock. Re-sentunchanged onevery call, andnever dropped.userThe task.Written once andread on everyturn after it.assistantThe model’s ownpast decisions,read back asordinary text.Delete one andit never calledthat tool.toolEach result,paired to the idof the call thatasked for it.the whole listagainNothing isrememberedbetween calls.This array isthe entirestate, and youown it.There is no session. Drop a tool result while trimming and leave its call behind, and the providerreturns a 400 rather than degrading gracefully, so trim in whole pairs.
There is no session. Drop a tool result while trimming and leave its call behind, and the provider returns a 400 rather than degrading gracefully, so trim in whole pairs.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

There is no session

The most common wrong mental model is that the model “remembers” the conversation and you are sending it updates. It does not. Every API call is stateless, and your harness re-sends the entire history each time.

Here is what step three of a small agent actually looks like on the wire. Details differ slightly between providers; the shape does not.

JSON
[
  { "role": "system",
    "content": "You are an operations assistant. Use tools; never guess an order id." },

  { "role": "user",
    "content": "Refund the duplicate charge on ORD-48213." },

  { "role": "assistant",
    "tool_calls": [
      { "id": "call_1",
        "function": { "name": "get_order",
                      "arguments": "{\"order_id\": \"ORD-48213\"}" } }
    ] },

  { "role": "tool",
    "tool_call_id": "call_1",
    "content": "{\"status\":\"shipped\",\"amount\":2499,\"refunded\":false}" }
]

Four messages, and the model reads all four before deciding anything. Three things in there are worth noticing.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Context Engineering exam.

Stuck on something?Ask Mai, your AI tutor

How to cite: Addaly (2026) ‘What the model actually sees each turn’, in Agents and Automation. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/agents-and-automation/the-message-list (Accessed: 29 November 2026).