mirror of
https://github.com/openai/codex.git
synced 2026-05-01 01:47:18 +00:00
Support prolite plan type (#17419)
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.
This commit is contained in:
@@ -12,6 +12,7 @@ pub enum PlanType {
|
||||
Go,
|
||||
Plus,
|
||||
Pro,
|
||||
ProLite,
|
||||
Team,
|
||||
#[serde(rename = "self_serve_business_usage_based")]
|
||||
#[ts(rename = "self_serve_business_usage_based")]
|
||||
@@ -53,11 +54,19 @@ mod tests {
|
||||
.expect("enterprise cbp usage based should serialize"),
|
||||
"\"enterprise_cbp_usage_based\""
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_string(&PlanType::ProLite).expect("prolite should serialize"),
|
||||
"\"prolite\""
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<PlanType>("\"self_serve_business_usage_based\"")
|
||||
.expect("self-serve business usage based should deserialize"),
|
||||
PlanType::SelfServeBusinessUsageBased
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<PlanType>("\"prolite\"").expect("prolite should deserialize"),
|
||||
PlanType::ProLite
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<PlanType>("\"enterprise_cbp_usage_based\"")
|
||||
.expect("enterprise cbp usage based should deserialize"),
|
||||
|
||||
@@ -16,6 +16,7 @@ impl PlanType {
|
||||
"go" => Self::Known(KnownPlan::Go),
|
||||
"plus" => Self::Known(KnownPlan::Plus),
|
||||
"pro" => Self::Known(KnownPlan::Pro),
|
||||
"prolite" => Self::Known(KnownPlan::ProLite),
|
||||
"team" => Self::Known(KnownPlan::Team),
|
||||
"self_serve_business_usage_based" => {
|
||||
Self::Known(KnownPlan::SelfServeBusinessUsageBased)
|
||||
@@ -36,6 +37,7 @@ pub enum KnownPlan {
|
||||
Go,
|
||||
Plus,
|
||||
Pro,
|
||||
ProLite,
|
||||
Team,
|
||||
#[serde(rename = "self_serve_business_usage_based")]
|
||||
SelfServeBusinessUsageBased,
|
||||
@@ -54,6 +56,7 @@ impl KnownPlan {
|
||||
Self::Go => "Go",
|
||||
Self::Plus => "Plus",
|
||||
Self::Pro => "Pro",
|
||||
Self::ProLite => "Pro Lite",
|
||||
Self::Team => "Team",
|
||||
Self::SelfServeBusinessUsageBased => "Self Serve Business Usage Based",
|
||||
Self::Business => "Business",
|
||||
@@ -69,6 +72,7 @@ impl KnownPlan {
|
||||
Self::Go => "go",
|
||||
Self::Plus => "plus",
|
||||
Self::Pro => "pro",
|
||||
Self::ProLite => "prolite",
|
||||
Self::Team => "team",
|
||||
Self::SelfServeBusinessUsageBased => "self_serve_business_usage_based",
|
||||
Self::Business => "business",
|
||||
|
||||
@@ -493,7 +493,7 @@ impl std::fmt::Display for UsageLimitReachedError {
|
||||
retry_suffix_after_or(self.resets_at.as_ref())
|
||||
)
|
||||
}
|
||||
Some(PlanType::Known(KnownPlan::Pro)) => format!(
|
||||
Some(PlanType::Known(KnownPlan::Pro | KnownPlan::ProLite)) => format!(
|
||||
"You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits{}",
|
||||
retry_suffix_after_or(self.resets_at.as_ref())
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user