Skip to main content

> GUIDE // REASONING

Reasoning Harnesses & Tool Loops

The ReAct loop, 8 lifecycle hooks, idempotent server actions, client tools, and durable stream recovery.

Executive Overview

The reasoning harness is the cognitive engine executing the iterative ReAct loop. Learn how lifecycle hooks intercept execution and how server actions differ from browser client tools.

1. The Iterative ReAct Cycle

The core reasoning harness executes an iterative state machine until goal convergence:

  1. Reasoning Step: The model outputs internal thinking reasoning about the current environment state.
  2. Tool Call Invocation: Model emits a structured tool call matching an registered schema.
  3. Execution & Sandboxing: Runtime executes the tool (server-side, browser CDP, or isolated container).
  4. Observation Injection: The raw output is formatted and fed back into the context window as a tool role turn.

Frequently Asked Questions

What is the role of lifecycle hooks?

Lifecycle hooks allow developers to intercept tool calls for human confirmation gates, token accounting, observability tracing, and dynamic prompt mutations.

AI Summary

The reasoning harness is the cognitive engine executing the iterative ReAct loop. Learn how lifecycle hooks intercept execution and how server actions differ from browser client tools.