One turn through Goose
architecture node:
User input:
Representation at this boundary
Source modules
Loop map
One pass — CLI →
Agent::reply → prompt assembly → provider → tools → feedback. Two loops ship: the legacy loop {} (default) and an opt-in effect-sourced state machine (GOOSE_STATE_MACHINE=1).Approval pause — when a tool call needs approval,
handle_approval_tool_requests registers a oneshot and yields ActionRequired; the loop is genuinely paused until submit_tool_confirmation delivers the verdict, resuming at step 6.Outer turn loop — after step 8 the
AgentEvent stream is rendered by the CLI; the turn bound is turns_taken > 1000 (the repetition inspector is inert); the next user message re-enters at step 1.