State-Machine Loop Pattern (Not Recursion)
- Entity ID:
ent-20260419-e20a11d171db - Type:
concept - Scope:
shared - Status:
active - Aliases: non-recursive agent loop
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
- query.ts is a 10-step state machine, not recursion
Relations
- State-Machine Loop Pattern (Not Recursion) --[informed_by]--> query.ts
- query.ts --[implements]--> State-Machine Loop Pattern (Not Recursion)