HARNESS ATLASAn Astra × QZ project ↗

CHAPTER 02 / 6 MIN READ

Close the loop

Actions become useful when observations can alter the next action.

START HERE

An agent tries to open a gate. The gate stays shut. If the agent never sees that result, a thousand additional instructions will not tell it which action failed.

THE IDEA

An agent loop converts the consequence of one action into the input for the next.

1.A loop has a state transition.

At each step, assemble the available information, choose an action, execute it, observe the result, and update the information for the next step. ReAct interleaves reasoning and action so environment observations can redirect the trajectory.

The loop does not need to be mysterious. A failed command returns an error; the next attempt uses that error. A search result supplies a name; the next query becomes narrower.

2.Execution is a source of evidence.

InterCode puts code inside an interactive environment: code is an action and execution produces an observation. That makes a command’s actual effect available to the agent instead of judging code solely as a string.

A successful tool call and a successful task are different events. A command can execute without producing the requested file. A page can load without containing the answer.

3.Stopping is part of the design.

An unbounded loop can keep retrying without progress. A harness needs limits and an end condition. A turn budget answers how long it may try; a completion check answers whether the job is done.

Useful feedback identifies a difference that the next action can address. Repeating the same attempt after an ignored error is a loop in the code, but not a repair in the behaviour.

THE MECHANISM / CONCEPTUAL DIAGRAM
01Choose action
02Execute
03Observe
04Update context
05Try again or stop
Teaching simulation

A locked gate

BEFORE

OPEN → “locked.” The single-attempt policy stops at failure.

AFTER

OPEN → “locked” → inspect the sign → obtain the specified key → unlock → open.

The retry is effective because the observation changes the action sequence.

TRY THE MECHANISMOpen the feedback experiment
↗

PAUSE & PREDICT

A command returned exit code 0. What do you know?

WHERE THIS IDEA STOPS

Retries consume resources and can repeat side effects. A real harness must decide which actions are safe to retry and which require checking the current state first.

GO TO THE SOURCE

ReAct2022 ↗InterCode2023 ↗

This chapter is an original teaching synthesis. Open each research note for source links, findings, and classification caveats.

TAKE IT INTO YOUR OWN WORK

Write one observable completion condition for a task you care about. Avoid “the agent says it is done.”

Saved in this browserNEXT CHAPTERRemember deliberately ↗