Expand description
HTTP infrastructure shared across modules.
A thin wrapper on top of client_util::build_https_client that adds: timeouts,
transport retry with jitter, HTTP/HTTPS proxy support, and a unified User-Agent.
HTTP client abstraction for the agent.
Current consumers: defect-llm (various LLM providers); planned: defect-tools’
fetch tool. This layer is extracted into its own crate to prevent the latter from
depending on defect-llm (which would create an inverted dependency).
Public entry points are only build_http_stack, HttpStackConfig, HttpStack,
and HttpStackError. Concrete layer implementations live in submodules as
pub(crate) and are not exposed outside the crate — callers see only a type-erased
Service.
Structs§
- Fetch
Http Client - HTTP client backing the
fetchutility. - Http
Stack Config - HTTP stack configuration.
- Proxy
Settings - Explicit proxy settings.
http_proxy/https_proxymay each beNone;no_proxyis a list of domain suffixes (following the GNUNO_PROXYconvention).
Enums§
- Http
Stack Error - HTTP stack-layer error.
- Proxy
Config - Proxy configuration.
- Timeout
Phase - Timeout phase. Mirrors
defect_agent::llm::TimeoutPhase, but this crate does not reference the agent’s type internally to avoid coupling the layer implementation to the LLM error model.
Functions§
- build_
default_ fetch_ client_ arc - Minimal version – allows the CLI to set up a fetch client even when a full
HttpStackConfigis not available. - build_
fetch_ client - Builds a fetch client from an
HttpStackConfig. - build_
fetch_ client_ arc - Convenience wrapper around
build_fetch_client+Arc::new— the common path used at CLI assembly points. - build_
http_ stack - Builds the full HTTP stack; the result can be fed directly to
toac::ApiClient::new. - build_
proxy_ connector - Build a full connector from
ProxyConfig. - default_
user_ agent - The default
User-Agentvalue isdefect-http/{CARGO_PKG_VERSION} ({DEFECT_HTTP_GIT_SHA}).
Type Aliases§
- Http
Stack - Type-erased service returned by
build_http_stack. - Proxy
Aware Connector - The full connector type used by upper layers to construct a
hyper_util::client::legacy::Client.