mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
Fall back to HTTP immediately for oversized WebSocket requests (#60840)
## Why A WebSocket close with code `1009` before any text arrives indicates that the request exceeds the peer's message size limit. Retrying the request over another WebSocket does not address that limit. ## What changed - Classify these early size rejections as requiring HTTP fallback and switch transports without exhausting WebSocket retries, including during prewarming. - Preserve ordinary stream retry behavior for size closes after any text frame and for other close codes. ## Testing Add integration coverage for early size rejections during generation and prewarming, size closes after metadata, rate limits, or response creation, and ordinary closes. GitOrigin-RevId: 4550d289bb414fec1faae2a195bcc635d394117b
This commit is contained in:
@@ -81,6 +81,7 @@ pub fn telemetry_api_error_message(error: &ApiError) -> String {
|
||||
ApiError::Transport(transport) => telemetry_transport_error_message(transport),
|
||||
ApiError::Api { status, .. } => format!("api error {}", status.as_u16()),
|
||||
ApiError::Stream(err) => err.to_string(),
|
||||
ApiError::WebsocketMessageTooLarge => error.to_string(),
|
||||
ApiError::ContentFilter => {
|
||||
"Incomplete response returned, reason: content_filter".to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user