# `Jido.Composer.Orchestrator.Strategy`
[🔗](https://github.com/lostbean/jido_composer/blob/main/lib/jido/composer/orchestrator/strategy.ex#L1)

Jido.Agent.Strategy implementation for LLM-driven orchestration.

Implements a ReAct-style (Reason + Act) loop: call LLM, execute tool calls,
feed results back, repeat until final answer or iteration limit.

All side effects are dispatched via directives — the strategy itself is pure.

## Error Handling

Error reasons are stored as structured data in `strat.result` (not stringified
via `inspect/1`), preserving error types for callers that pattern-match on them.
LLM-facing error context (tool results, conversation messages) continues to use
string representations since the LLM consumes text.

All error paths close open observability spans (agent, iteration) to ensure
telemetry is emitted even on failure.

# `replay_directives_from_state`

```elixir
@spec replay_directives_from_state(map()) :: [struct()]
```

Returns replay directives for restoring in-flight operations from checkpoint state.

Called by `Checkpoint.replay_directives/1` via `function_exported?/3` delegation.

# `strip_for_checkpoint`

```elixir
@spec strip_for_checkpoint(map()) :: map()
```

Strategy-specific closure stripping for checkpoint serialization.

Called by `Checkpoint.prepare_for_checkpoint/1` via delegation.
Strips closures from nested structures (e.g., `approval_gate.approval_policy`)
in addition to top-level function values.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
