codex - ✅(Solved) Fix codex-cli fails to decode rate-limit response when plan_type is "prolite" [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17353Fetched 2026-04-11 06:17:08
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×2

Error Message

failed to fetch codex rate limits: Decode error for https://chatgpt.com/backend-api/wham/usage: unknown variant prolite, expected one of guest, free, go, plus, pro, free_workspace, team, self_serve_business_usage_based, business, enterprise_cbp_usage_based, education, quorum, k12, enterprise, edu

PR fix notes

PR #17419: Support prolite plan type

Description (problem / solution / changelog)

Addresses #17353

Problem: Codex rate-limit fetching failed when the backend returned the new prolite subscription plan type.

Solution: Add prolite to the backend/account/auth plan mappings, keep unknown WHAM plan values decodable, and regenerate app-server plan schemas.

Changed files

  • codex-rs/app-server-protocol/schema/json/ServerNotification.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json (modified, +1/-0)
  • codex-rs/app-server-protocol/schema/typescript/PlanType.ts (modified, +1/-1)
  • codex-rs/backend-client/src/client.rs (modified, +3/-1)
  • codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs (modified, +4/-0)
  • codex-rs/login/src/auth/manager.rs (modified, +1/-0)
  • codex-rs/login/src/token_data_tests.rs (modified, +6/-0)
  • codex-rs/protocol/src/account.rs (modified, +9/-0)
  • codex-rs/protocol/src/auth.rs (modified, +4/-0)
  • codex-rs/protocol/src/error.rs (modified, +1/-1)
  • codex-rs/tui/src/status/helpers.rs (modified, +3/-0)
  • codex-rs/tui/src/tooltips.rs (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.118.0

What subscription do you have?

Unknown; backend returns plan_type=prolite

Which model were you using?

Not model-specific

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

tmux on WSL2 (Ubuntu 24.04)

What issue are you seeing?

Codex CLI fails while fetching rate limits from:

https://chatgpt.com/backend-api/wham/usage

The response includes:

{ "plan_type": "prolite" }

and Codex errors with:

failed to fetch codex rate limits: Decode error for https://chatgpt.com/backend-api/wham/usage: unknown variant prolite, expected one of guest, free, go, plus, pro, free_workspace, team, self_serve_business_usage_based, business, enterprise_cbp_usage_based, education, quorum, k12, enterprise, edu

What steps can reproduce the bug?

  1. Log in with an account whose /backend-api/wham/usage response returns "plan_type": "prolite".
  2. Trigger Codex rate-limit fetching.
  3. In my case this reproduces via:

codexbar --provider codex --source cli

The underlying failure appears to come from codex CLI itself, not CodexBar.

What is the expected behavior?

Unknown plan_type values should not fail rate-limit fetching. They should deserialize safely and fall back to an unknown plan type.

Additional information

This looks like a closed-enum deserialization issue in the rate-limit payload path.

A safe fix would be to accept unknown plan_type values and map them to Unknown instead of failing the whole request.

Additional information

No response

extent analysis

TL;DR

Update the Codex CLI to handle unknown plan types by mapping them to an "Unknown" category instead of failing.

Guidance

  • Identify the specific line of code where the plan_type is being deserialized and verify that it's using a closed enum.
  • Modify the deserialization logic to include a catch-all or default case for unknown plan types, mapping them to "Unknown".
  • Test the updated code with the provided reproduction steps to ensure it no longer fails when encountering the "prolite" plan type.
  • Consider adding logging or monitoring to track instances where unknown plan types are encountered, to inform future updates or fixes.

Example

# Example deserialization logic update
from enum import Enum

class PlanType(Enum):
    GUEST = "guest"
    FREE = "free"
    # ... other known plan types ...

def deserialize_plan_type(plan_type_str):
    try:
        return PlanType(plan_type_str)
    except ValueError:
        # Map unknown plan types to "Unknown"
        return "Unknown"

Notes

The provided information suggests a closed-enum deserialization issue, but without access to the specific code, the exact fix may vary. This guidance assumes a Python-based implementation, but the concept applies to other languages as well.

Recommendation

Apply a workaround by updating the deserialization logic to handle unknown plan types, as this will allow the Codex CLI to continue functioning without failing due to unknown plan types.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - ✅(Solved) Fix codex-cli fails to decode rate-limit response when plan_type is "prolite" [1 pull requests, 1 participants]