Skip to content

Transport dependencies

Transport architecture, dependency ownership and developer build commands live here. For public calls see API.md, composed workflows HELPERS.md, and behavioral guarantees CONTRACTS.md.

Gun 2.8.0 is the sole SDK transport dependency and starts with the openai application. Application startup does not open network connections. The internal SDK transport implements buffered HTTPS over HTTP/1.1 with sequential connection reuse. Stable Realtime additionally exposes direct verified WSS and raw messages. Controlled SSE-over-HTTPS and WSS fixtures exercise Gun. SDK SSE streaming and raw WSS are implemented; typed Realtime WS events and automatic reconnect remain unimplemented. Buffered Responses create/retrieve/delete, cancel, compact and input-token count use this same pipeline. HTTP/2 is not enabled.

Gun and Cowlib 2.22.0 are locked in rebar.lock. Cowboy 2.21.0 and Ranch 2.4.0 are pinned only in the test profile for HTTPS/SSE/WSS fixtures; fixtures explicitly start Cowboy with application:ensure_all_started(cowboy). Cowboy and Ranch are not required applications of openai. Rebar3 does not lock non-default profile dependencies, so their exact versions are in rebar.config.

Responsibilities:

Component Responsibility
Client coordinator Stores configuration and tracks leases, request admission and HTTP context lifecycle. Callbacks do not wait for network operations or process response payloads.
Connection worker Remains the Gun owner and manages connection startup and cleanup.
WSS driver A temporary root child owns one independent Realtime session, raw queues and receive/send waits. It reuses the connection worker/Gun outside the HTTP lease pool; opened sessions survive HTTP Client close.
Request driver Sends a request and its redirect hops under one deadline, buffers responses, and coordinates cancellation and cleanup outside the coordinator.

See Public contracts for lifecycle guarantees, limits, errors and the target Realtime lifecycle. Future SDK SSE/WS behavior and full Python parity are not implied by the transport fixtures.

Build and analyze the SDK or the test profile:

rebar3 compile
rebar3 check
rebar3 as test compile
rebar3 as test check