The ProductionAgent class wraps the adapter with safety limits, parallel execution, and per-tool timeouts.
Two layers, two responsibilities
The Adapter knows the wire: how to format messages for this provider, how to parse this provider's events, how to send tool results in this provider's shape. The Orchestrator knows the loop: when to call a handler, when to log to JSONL, when to break, when to apply hooks.
Putting the loop inside the Adapter is the most common architectural mistake. It feels simpler ('the adapter handles everything!') but it makes per-call instrumentation impossible. You can't add a logging hook for a single tool call. You can't intercept arguments before the handler runs. You can't replay-test the loop independently of the wire. Keep them separate.