Agent loop
The observe → think → act cycle an agent repeats until it stops.
The agent loop is the core control structure: (1) the model receives the current context (goal, history, latest observation), (2) produces reasoning and/or an action, (3) the runtime executes the action and appends the result, (4) repeat until the model emits a final answer or a step/cost limit is hit. Almost every agent framework — ReAct, SWE-agent, Claude Code, OpenAI's Agents SDK — is a variation on this loop with different prompting, memory and termination rules. Loop length and per-step reliability together determine end-to-end success (see pass^k).