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/ingress/src/pipeline/inbound.rsResponsibilityDetect request path, read body, parse protocol payload, normalize inbound request metadata.
- 2routingModules
src/routing/src/config.rsResponsibilityResolve explicit route or protocol-aware default provider; enforce request_protocol guards.
- 3
provider_requestModulessrc/provider/*/requestsrc/translation/ResponsibilityTranslate payload if protocols differ, rewrite provider model, serialize the upstream request.
- 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_responseModulessrc/translation/src/http_support/ResponsibilityTranslate provider response back to the inbound protocol and rebuild the client HTTP response.
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. |