# Classify OpenAI subscription usage limits correctly \(\#63738\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ee3b5558c581429633937e458fad8d109f29e9ee)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ee3b5558c581429633937e458fad8d109f29e9ee

Requested commit: ee3b5558c581429633937e458fad8d109f29e9ee

Commit: ee3b5558c581429633937e458fad8d109f29e9ee

Tree: aac1fac084b228fa21e687397955447cbb20ace6

Author: Conrad Irwin

Committer: GitHub

## Message

```
Classify OpenAI subscription usage limits correctly (#63738)

OpenAI's Codex endpoint reports an exhausted ChatGPT subscription with
HTTP 429 and `error.type = "usage_limit_reached"`, but no `error.code`.
The Responses parser discarded the type and classified the response from
its status alone, making it appear to be transient request throttling.

This preserves `error.type` in both Responses and Chat Completions
parsing, considers both OpenAI discriminator fields during
classification, and falls back from the more-specific `error.code` to
`error.type` when populating the existing provider rejection code.
Usage-limit errors retain OpenAI's message and are not retried as
transient 429s.

The regression coverage exercises initial HTTP failures, Responses
stream errors, Chat Completions stream errors, unknown OpenAI-compatible
provider types, and precedence when both code and type are present.

Release Notes:

- Fixed ChatGPT subscription usage limits being shown as temporary
OpenAI request throttling.
```

## Parents

- [5313741ffaa73955ccf5b7cb2c8e15e61d9f92d3](https://git.cafe/gitcafe/zed/commit/5313741ffaa73955ccf5b7cb2c8e15e61d9f92d3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ee3b5558c581429633937e458fad8d109f29e9ee?format=markdown)
