State-Machine Loop Pattern (Not Recursion)

Description

Architectural decision to structure the agent iteration as a while-loop state machine instead of a recursive call tree, specifically to avoid stack overflow across hundreds of tool calls in long sessions.

Key claims

Relations

Sources

src-20260419-f46b0a2fccd9