mirror of
https://github.com/openai/codex.git
synced 2026-10-17 17:08:55 +00:00
## Why Destination restrictions and policy revocation must remain effective during redirects, response body reads, and established WebSocket traffic. Policy denials must also survive error handling so callers do not retry them or report a revoked operation as successful. ## What changed - Route managed HTTP clients through a shared `RequestBuilder` and policy-aware execution, checking each redirect destination before route resolution and retaining a network permit while consuming response bodies. - Guard WebSocket connection setup, reads, and writes with revocable permits, including independent wakeups for split readers and writers. - Preserve `TransportError::Policy` through HTTP, SSE, and realtime error handling, and treat policy denials as non-retryable. - Keep the supplied network policy in plugin startup HTTP requests and propagate response body failures from backend and plugin requests. ## Testing Add regression coverage for rejection before connecting, revocation during redirect routing and streamed body reads, split WebSocket revocation, realtime writer error propagation, and revoked plugin upload responses. GitOrigin-RevId: fba36700444c98a8364c09b4dc5452c4d78a90fb
codex-client
Higher-level request policy layered on codex-http-client without any Codex/OpenAI API awareness.
- Provides retry utilities (
RetryPolicy,RetryOn,run_with_retry,backoff) that callers plug into for unary and streaming calls. - Supplies the
sse_streamhelper to turn byte streams into raw SSEdata:frames with idle timeouts and surfaced stream errors. - Defines the request telemetry callback used by higher-level clients.
- Re-exports the low-level HTTP types temporarily so consumers can migrate to
codex-http-clientincrementally.