mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-20 15:40:29 +01:00
3c2848e919
OpenAI can return structured provider failures either as Responses stream events or as non-success HTTP responses. The streaming path classified the provider's error code, while the HTTP path treated the body as opaque and classified only its status. As a result, exhausted credit could look like a retryable rate limit, and prompt policy rejections looked like generic provider failures. This change gives billing failures their existing payment-required category and adds a content-policy category for `invalid_prompt` and `cyber_policy`. It also parses OpenAI's standard HTTP error envelope and sends both HTTP and stream failures through the same classifier while preserving the original status, code, and message. Responses with another body format retain the previous status-based fallback. Release Notes: - N/A