# `Jido.AgentServer.Options`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/agent_server/options.ex#L1)

Options for starting an AgentServer.

> #### Internal Module {: .warning}
> This module is internal to the AgentServer implementation. Its API may
> change without notice.

Validates and normalizes startup options including agent configuration,
hierarchy settings, error policies, and dispatch configuration.

# `error_policy`

```elixir
@type error_policy() ::
  :log_only
  | :stop_on_error
  | {:emit_signal, dispatch_cfg :: term()}
  | {:max_errors, pos_integer()}
  | (error :: term(), state :: map() -&gt; {:ok, map()} | {:stop, term(), map()})
```

# `on_parent_death`

```elixir
@type on_parent_death() :: :stop | :continue | :emit_orphan
```

# `t`

```elixir
@type t() :: %Jido.AgentServer.Options{
  agent: any(),
  agent_module: nil | atom(),
  debug: boolean(),
  default_dispatch: nil | any(),
  error_policy: any(),
  id: nil | binary(),
  idle_timeout: any(),
  initial_state: map(),
  jido: nil | atom(),
  lifecycle_mod: atom(),
  max_queue_size: integer(),
  on_parent_death: atom(),
  parent: nil | any(),
  partition: nil | any(),
  pool: nil | atom(),
  pool_key: nil | any(),
  register_global: boolean(),
  registry: atom(),
  restored_from_storage: boolean(),
  skip_schedules: boolean(),
  spawn_fun: nil | any(),
  storage: nil | any()
}
```

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Creates validated Options from a keyword list or map.

Normalizes and validates all options, including:
- Generating an ID if not provided
- Validating the agent module/struct
- Validating error policy
- Parsing parent reference

Returns `{:ok, options}` or `{:error, reason}`.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Creates validated Options from a keyword list or map, raising on error.

# `validate_error_policy`

```elixir
@spec validate_error_policy(term()) :: {:ok, error_policy()} | {:error, term()}
```

Validates an error policy value.

