Building a Coding Agent in Swift, Part 1: The Agent Loop

The agent loop that drives everything — how a single stopReason check turns an API client into an autonomous agent.