Lesson 2 of 5
What happens between the request and the result?
A harness turns one request into a sequence of small events: the model proposes an operation, the harness runs it, a result comes back, and the model proposes again. This lesson traces that sequence for the fencing comparison using an authored record, then shows which lines in such a record are evidence of what happened and which are only the model's words.
Numbered links identify sources. Underlined terms offer a definition without leaving the lesson.
The loop: propose, execute, observe, decide again
The previous lesson defined a harness as the software that sends the model context, recognizes tool calls, runs them and returns results. Put those jobs in order and they form a loop, which this course calls the . First, the harness sends the model its context: instructions, the request, descriptions of the available tools and any results so far. Second, the model generates output, which is either a tool call or a message for the person. Third, if the output is a tool call, the harness decides whether to run it, a decision the next lesson examines, and runs it if allowed. Fourth, the result of that operation is added to the context as an : the file contents, the folder listing, the status a server returned, or an error. Then the model generates again, with the observation now part of what it can use.
The loop ends in one of a few ways. The model produces a final message instead of a call. Or the harness stops it: because a limit on steps or spending was reached, because an error it treats as fatal occurred, or because a person stopped it. OpenAI's documentation describes an application continuing this flow for as many tool calls as the task requires, and notes that a model may request several calls in one turn. 1 The Hugging Face course describes the loop continuing until the agent's objective has been fulfilled. 2 Read that as the intended design. In practice the loop ends when the model stops or the harness stops it, and neither ending shows that the objective was met. That is a claim to check afterwards, and this lesson explains how.
An observation is what the tool returned. It is not a statement about the world beyond what that operation could see. Module 2 made this point for a folder listing, which shows names and not contents. It holds for every tool: a search result shows what the search covered, a status shows how a server handled a request, and an error describes what failed from the tool's perspective. A timeout can still leave a remote action's outcome unknown.
An authored trace of the fencing comparison
Here is the fencing request again, now given to a fictional harness. Everything below is authored for the lesson. No software produced it, and real products record these events in their own formats.
The harness offers five tools: list_folder, read_file, write_file, fetch_url and send_email. The email tool is connected to the garden's account, which is authorized to send. For this example, the harness runs folder listings and file reads without asking, and it pauses for the organizer's approval before any tool that writes, fetches from the web or sends. The next lesson explains such arrangements; here it is a stated condition of the example. The Suppliers folder holds three files: a brief and two quotes. The request is: “Compare the fencing quotes for the north boundary and save a comparison table as Garden/fencing-comparison.txt.”
The record below is what this module calls a trace. Each line is labelled with what produced it: the model, the harness, an observation returned by a tool, or the person.
1 [model] I will list the Suppliers folder, read each quote, then write the table.
2 [model: call] list_folder Garden/Suppliers
3 [observation] fencing-brief.txt northfence-quote.txt hedgerow-quote.txt
4 [model: call] read_file Garden/Suppliers/fencing-brief.txt
5 [observation] "North boundary, 40 m. Quotes requested from Northfence, Hedgerow and
Parkside. Parkside sent theirs as a link: https://parkside-fencing.example/quote/1187"
6 [model: call] read_file Garden/Suppliers/northfence-quote.txt
7 [observation] "Northfence. 40 m timber, £2,150 including installation. Delivery 3 weeks.
5-year guarantee."
8 [model: call] read_file Garden/Suppliers/hedgerow-quote.txt
9 [observation] "Hedgerow Fencing. 40 m timber, £1,980. Installation extra, £300.
Delivery 6 weeks. 2-year guarantee."
10 [model: call] fetch_url https://parkside-fencing.example/quote/1187
11 [harness] Asking before a web fetch. [person] approved
12 [observation] error: connection timed out after 30 seconds
13 [model: call] fetch_url https://parkside-fencing.example/quote/1187
14 [harness] Asking before a web fetch. [person] approved
15 [observation] error: connection timed out after 30 seconds
16 [model: call] write_file Garden/fencing-comparison.txt
contents: a table with rows for Northfence, Hedgerow and
"Parkside: quote not retrieved (link timed out twice)"
17 [harness] Asking before a file write. [person] approved
18 [observation] wrote 412 bytes to Garden/fencing-comparison.txt
19 [model: call] send_email to: quotes@parkside-fencing.example
subject: "Fencing quote 1187"
body: "Could you send the quote as an attachment? The link times out."
20 [harness] Asking before sending an email. [person] (waiting)
The trace stops at line 20 for now, with the harness waiting for the organizer's answer. The next lesson returns to that line. Before then, read the record for what it shows.
One arithmetic point belongs here, because the record makes it checkable. Hedgerow's headline price is lower than Northfence's, but line 9 says installation costs £300 extra. Installed, Hedgerow comes to £1,980 plus £300, which is £2,280, against Northfence's £2,150 including installation. Whether the written table makes that comparison correctly is not something line 18 can tell you.
Which lines are evidence, and of what
Line 1 is a plan. It is a message the model generated, and it describes events that have not happened. A plan that reads well is easy to mistake for progress, so keep the distinction sharp: nothing on line 1 is evidence that a folder was listed or a file read. Lines 2, 4, 6, 8, 10, 13, 16 and 19 are also model outputs. They are requests, and each one became an event only when the harness acted on it.
Lines 3, 5, 7, 9, 12, 15 and 18 are observations. The harness produced them from what the tools returned, so they are evidence that an operation ran and evidence of what it returned. That is as far as the evidence goes. Line 18 shows that a file of 412 bytes was written at that path; it shows nothing about whether the table inside is right. Line 12 shows that one fetch timed out; it does not show that Parkside's quote is unavailable, only that this link did not answer within thirty seconds on that attempt. Lines 11, 14 and 17 record the harness pausing and the person answering, which is evidence of a decision, not of the operation's outcome. The final message the model will eventually write is, like line 1, a claim.
The sequence of calls, harness decisions and observations that the harness recorded is the . It is the evidence you have about what an agent did, and its value depends on the harness recording faithfully and showing you the record. An action record does not explain the internal calculations that produced a model's choice. Some products display text labelled as the model's thinking or reasoning before a call. That text is generated output like any other, and this course does not treat it as a log of what happened inside the model. The Hugging Face course names its first step “thought” and writes an example thought for its weather agent; that is a teaching device, and the course does not claim to have recorded a computation. 2
Products differ in how much of the record they show, which changes what you can check. Google publishes a sample data-analysis agent built with its Agent Development Kit, a toolkit for building agents. In the sample's example conversation, a request to plot total sales per country is handled by a database step, which turns the question into a database query, followed by an analysis step that draws the chart. The reply tells the user that the database agent was called to retrieve total sales per country from a named table; the query itself does not appear in that exchange. 7 That sentence is a generated description of an operation. To check the chart you would need the query and its result, which the harness may or may not expose. So the first question to ask of any product is whether you can see the operations and their results, or only descriptions of them. The linked revision preserves this example after its removal from the live repository. It illustrates what to inspect, rather than documenting current product behavior.
Tools do not make the answer reliable
Every observation in the trace is accurate for what it is, and the comparison can still be wrong. The table on line 16 might list Hedgerow as the cheaper quote if the model did not add the installation charge. The observations contained the right numbers; the arithmetic and the comparison happened in the model's generation, where module 1's checks still apply. A tool brings evidence into the context, in the same way that retrieval brought a notice into the context in module 1. The model still has to interpret that evidence, and the interpretation is generated text.
The failed fetch shows a second way. The model on line 16 wrote “quote not retrieved,” which the record supports. A different run of the same request could have written “Parkside declined to quote,” an explanation the record does not contain. Module 1 called an unsupported addition a hallucination, and an error message is an input the model can hallucinate around, as easily as a silent note. Observations constrain the answer. They do not dictate it, and a tool call in the record is not a reason to skip reading the result.
Carry this forward
- The loop is propose, execute, observe, decide again. It ends when the model stops or the harness stops it, and neither ending proves the request was met.
- A plan and a tool call are model outputs. An observation is what the harness returned after running a tool: evidence that an operation ran and of what it returned, and no more.
- The action record is the sequence of calls, harness decisions and observations the harness recorded. Displayed reasoning text is generated output, not a log of the computation, and some products show only descriptions of operations.
- A correct observation can still lead to a wrong conclusion. Check the model's interpretation of a result the way module 1 checked a reply against the note.
Lesson check
Choose an answer for each question.
This is a practice check. Answers reset when you leave this page. Results are not saved and do not place you in another module or award a qualification.
Line 20 is still waiting. Someone has to decide whether the email goes. The next lesson is about who decides, and what actually stops an action.
Sources · Reviewed 2026-09-29
- 1. OpenAI: Function calling
- 2. Hugging Face Agents Course: Understanding AI agents through the thought-action-observation cycle
- 7. Google ADK: archived data-science sample at b1910c6
Sources support nearby explanations. Product details can change. Scenarios and model results are authored illustrations unless a lesson explicitly identifies a recorded execution. Module 7 identifies its offline code checks.