Normandy.Options
(normandy v2.2.0)
View Source
Option validation for Normandy's public entry points.
An entry point keeps a NimbleOptions schema and calls validate!/3 with its own
{module, function, arity}. Options may be a keyword list or a map with atom keys. Any
problem raises ArgumentError whose message starts with Module.function/arity: and
names the option:
Normandy.Agents.BaseAgent.init/1: unknown option :api_kye; supported: :client, :model, ...The value of an option named in sensitive_keys/0, or nested under one, never appears in
a message: the message names the option and shows its :type_doc instead. Give every such
option a :type_doc in its schema. Whatever the option, a map, list or tuple value is
never echoed either (it can hold a secret under any key): the message states its type, for
example got: a map. Scalar values appear as NimbleOptions words them.
Timeouts
Every option a caller waits on is called :timeout and takes ms or :infinity, except the
durable server's two _ms options (not waits on a call; they also take ms or :infinity)
and the Mnesia stores' :wait_timeout (ms or :infinity, as :mnesia.wait_for_tables/2). A
:timeout that bounds one tool call takes positive ms only: a tool call is always bounded.
Defaults:
| Option | Where | Default |
|---|---|---|
:timeout | AgentProcess.run/3 | :infinity |
:timeout | AgentProcess.update_agent/3 | :infinity |
:timeout | AgentPool.checkout/2, AgentPool.transaction/3 | 5_000 |
:timeout | Reactive.race/3, all/3, some/3 | 60_000 |
:timeout | ParallelOrchestrator.execute/3, execute_stream/2 | 300_000 per agent |
:timeout | Batch.Processor.process_batch/3 and its variants, BaseAgent.process_batch/3 | 300_000 per item |
:timeout (positive ms) | Toolset.register/3, BaseAgent.register_tool/3, DSL tool Mod, timeout: ms | the tool call's timeout; unset: 30_000 (Tools.Executor.default_timeout/0) |
:timeout (positive ms) | Tools.Executor.execute_tool/2, execute_tool_classified/2 | 30_000 (the dispatcher passes the registration timeout) |
:timeout (positive ms) | A2A.Registry.discover_and_register/3 | 60_000 (each registered tool's timeout) |
:approval_timeout_ms | Turn.Server.start_link/1 | 300_000 |
:idle_timeout_ms | Turn.Server.start_link/1 | 60_000 |
:wait_timeout | SessionStore.Mnesia.create_tables/1, MemoryStore.Mnesia.create_tables/1 | 30_000 |
| (none) | Turn.Server.run/2 | :infinity |
CircuitBreaker.start_link/1's :timeout (60_000) is how long an open breaker waits before
it lets probe calls through, not a call timeout.
Summary
Functions
The Markdown option list for schema, to embed in an @doc.
Option names whose values are never shown in an error message.
Validates opts against schema and returns them as a keyword list with the schema's
defaults filled in.
Functions
@spec docs(NimbleOptions.t()) :: String.t()
The Markdown option list for schema, to embed in an @doc.
@spec sensitive_keys() :: [atom()]
Option names whose values are never shown in an error message.
Validates opts against schema and returns them as a keyword list with the schema's
defaults filled in.
Raises ArgumentError prefixed with Module.function/arity: (from mfa) for an unknown
or duplicated option, a missing required one, a bad value, or opts that are neither a
keyword list nor a map with atom keys.