Request Lifecycle
Request Lifecycle
Section titled “Request Lifecycle”This page describes the source-level request path. User-facing behavior lives in Using ProxAI and protocol behavior lives in Protocol Guide.
Stages
Section titled “Stages”- 1
inbound_requestModulessrc/pipeline/inbound.rscrates/proxai-core/src/pipeline/crates/proxai-core/src/ingress/ResponsibilityDetect the request path and parse body bytes in the app, then let the core pipeline normalize and validate the structured payload.
- 2routingModules
crates/proxai-core/src/pipeline/crates/proxai-core/src/routing/src/pipeline/provider_request.rsResponsibilityResolve a provider label, protocol, compatibility policy, and upstream model in core, then map the label to an application HTTP transport.
- 3
provider_requestModulescrates/proxai-core/src/pipeline/crates/proxai-core/src/translation/crates/proxai-core/src/provider/request/src/provider/*/requestResponsibilityReturn a prepared provider value and matching response pipeline from core, then serialize the upstream request in the application.
- 4provider transportModules
src/provider/*/transportResponsibilityConstruct upstream URL, attach provider-owned auth headers, and send via HTTP.
- 5
upstream_responseModulessrc/upstream/src/provider/*/responseResponsibilityRead status, headers, non-streaming body, or streaming byte carrier.
- 6
outbound_responseModulescrates/proxai-core/src/pipeline/src/sse_translation.rssrc/http_support/ResponsibilityRun structured provider normalization and translation through
ResponsePipeline, then rebuild the client HTTP/SSE response in the application.
Important invariants
Section titled “Important invariants”| Invariant | Reason |
|---|---|
Translation does not own HTTP Response | The translation layer should stay pure at the carrier boundary. |
| Provider auth comes from provider config | Client-supplied Authorization does not control upstream provider auth. |
| Route match errors are explicit | A protocol guard mismatch should not fall through to a different provider. |
| Streaming completion is semantic | Completion requires terminal protocol events, not just socket closure. |