Skip to main content

Module client

Module client 

Source
Expand description

Intelligence client — endpoint list selection plus one round-trip.

The transport is HTTPS: each AGENTD_INTELLIGENCE list element is an https:// URL, and plaintext http:// is admitted only for a loopback host as a dev carve-out. The wire is HTTP/1.1, with the gateway or provider speaking an OpenAI-compatible /chat/completions. Each request opens its own connection and sends Connection: close: model calls are seconds apart and minutes long, so a connection pool would buy nothing and cost a whole class of stale-socket failures.

--intelligence is an ordered list — a primary plus fallbacks — and complete() drives it through the sticky-primary failover policy (super::failover) with a per-endpoint health record and circuit breaker (super::health). Selection is the only layer the list adds: the wire/adapter/JSON path underneath is identical either way, and with a single endpoint the failover machinery is inert, so one endpoint costs nothing.

Structs§

AllDownPolicy
Bounded, jittered all-down backoff. A daemon re-arms the sweep up to max_retries times, sleeping base × 2^n capped at max with per-attempt jitter, before surfacing the terminal all-down. The bound matters: without max_retries a permanently misconfigured endpoint would keep a daemon alive and silent forever instead of failing visibly.
IntelClient
A resolved intelligence client over an ordered endpoint list.
IntelHealthReport
The edge-triggered intelligence-reachability report a child emits upward. active is the bounded (index, transport-scheme) of the serving endpoint: transport and index ONLY, never a URL, host, cid or credential, because this crosses a process boundary into the supervisor’s observable surface. It is None on entering all-down, when nothing is serving.

Enums§

IntelError
Provider
Which in-binary adapter speaks to the endpoint. OpenAI-compatible is the default; Anthropic Messages and Bedrock Converse are the other two dialects compiled in. The set stops here deliberately: any other provider is reached through a gateway, which keeps provider quirks out of the binary.
Transport
Per-endpoint dial transport, owned by super::endpoints. Intelligence is HTTPS-only, so there is exactly one TCP shape: tls: true in production. tls: false exists solely for the loopback dev/test carve-out that backs the built-in mock LLM, and [resolve] rejects it for any non-loopback host — the variant cannot be reached with a real remote address.