Skip to main content

Module context

Module context 

Source
Expand description

Proxy context data structures.

The per-request ProxyContext composes several single-responsibility sub-structs so each cluster of related fields can be reasoned about (and initialised) independently:

  • RouteInfo — backend selection + path rewriting (populated in request_filter).
  • ConversionFlags — boolean state machine that drives whether and how bodies are converted.
  • ConversionBuffers — buffered request/response bodies + stream parse cursor.
  • UpstreamDiagnostics — observed upstream status / content-type / chunk count, kept for logging and bypass decisions.
  • FollowUpContext — conversation messages we’ll persist after the upstream completes (for previous_response_id expansion).

The root keeps only fields that don’t fit any cluster: start_time, model, and the streaming StreamState.

Structs§

ConversionBuffers
Buffered request/response bodies and the stream-parse cursor.
ConversionFlags
Boolean state machine that records what kind of conversion is in flight.
FollowUpContext
Information needed to persist a completed turn for subsequent previous_response_id lookups.
ProxyContext
Proxy context attached to each request session.
RouteInfo
Backend selection and request-path information.
UpstreamDiagnostics
Upstream observations for diagnostics + bypass decisions.