Isolated timeout and crash boundary for external provider calls.
Calls run outside the requesting process. A small coordinator links the adapter worker to both the caller lifecycle and the configured timeout, so a timed-out call or dead caller terminates the local adapter worker. Remote work already handed to an external service can only be cancelled when that adapter supports cancellation itself. Route evaluation also uses this boundary as the canonical source of sanitized provider outcome and duration facts.
The same boundary is used for application callbacks executed by a turn. The callback contracts are:
| Kind | Supported arities | Normalized success | Timeout | Failure policy |
|---|---|---|---|---|
:run | 1, 2 | a Spectre.Result or visible reply value | :run_timeout, 30s | abort the handler turn |
:renderer | 1, 2, 3 | a binary reply | :renderer_timeout, 10s | abort the handler turn |
:hook | 0, 1, 2, 3 | :ok or {:ok, value} | :hook_timeout, 10s | aggregate and report |
:prompt | 0, 1, 2 | a boolean condition or binary context | :prompt_timeout, 10s | abort required operations, skip optional ones |
:input | init/1, call/3 | a valid pipeline transition | :input_timeout, 10s | abort the turn |
:turn_handler | handle_turn/2 | :cont or a typed reply | :turn_handler_timeout, 30s | abort the turn (fail closed) |
:router | init/1, call/2 | a valid pipeline transition | :router_timeout, 120s | abort the routing pipeline |
:monitor | 0, 1, 2, 3 | callback-specific host data | :monitor_timeout, 60s | enter or continue recovery |
Model, classifier, embedding, semantic-cache, action, state, memory, and
journal adapters use their existing provider-specific timeout keys. Every
timeout accepts :infinity only when explicitly configured. Declared
{:error, reason} replies are returned unchanged; exceptions, exits, throws,
hard crashes, timeouts, and malformed envelopes become privacy-safe
Spectre.Provider.Failure values. Calls are attempted exactly once.
Summary
Functions
Runs one provider function under its configured timeout.
Types
Functions
Runs one provider function under its configured timeout.
Provider-specific options override :provider_timeout:
:llm_timeout:local_classifier_timeoutor:classifier_timeout:embedding_timeout:semantic_cache_timeout:run_timeout:renderer_timeout:hook_timeout:input_timeout:router_timeout:monitor_timeout:turn_handler_timeout
Application defaults may be configured under config :spectre, :provider.