From 61e776410b3ab35339ef6b34a0aec21f3a00ab1e Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 10 Apr 2026 20:36:33 -0700 Subject: [PATCH] Support prolite plan type --- .../schema/json/ServerNotification.json | 1 + .../schema/json/codex_app_server_protocol.schemas.json | 1 + .../json/codex_app_server_protocol.v2.schemas.json | 1 + .../json/v2/AccountRateLimitsUpdatedNotification.json | 1 + .../schema/json/v2/AccountUpdatedNotification.json | 1 + .../schema/json/v2/GetAccountRateLimitsResponse.json | 1 + .../schema/json/v2/GetAccountResponse.json | 1 + .../app-server-protocol/schema/typescript/PlanType.ts | 2 +- codex-rs/backend-client/src/client.rs | 4 +++- .../src/models/rate_limit_status_payload.rs | 4 ++++ codex-rs/login/src/auth/manager.rs | 1 + codex-rs/login/src/token_data_tests.rs | 6 ++++++ codex-rs/protocol/src/account.rs | 9 +++++++++ codex-rs/protocol/src/auth.rs | 4 ++++ codex-rs/protocol/src/error.rs | 2 +- codex-rs/tui/src/status/helpers.rs | 3 +++ codex-rs/tui/src/tooltips.rs | 2 +- 17 files changed, 40 insertions(+), 4 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json index ec368762cf0..cf9beee8b7b 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -2009,6 +2009,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 429d251c796..61ab63cd65d 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -9838,6 +9838,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 50cc1328beb..dfc75b837db 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -6641,6 +6641,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json index d1812f069ff..67a5f055b36 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json @@ -28,6 +28,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json index f2cf7cb3ab4..64109ca2a0b 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json @@ -33,6 +33,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json b/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json index 23f7d3cfdc2..2d34ee47d12 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json @@ -28,6 +28,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json b/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json index acaa7791846..8534927157a 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json @@ -51,6 +51,7 @@ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", diff --git a/codex-rs/app-server-protocol/schema/typescript/PlanType.ts b/codex-rs/app-server-protocol/schema/typescript/PlanType.ts index ad5bcab380b..44891467e92 100644 --- a/codex-rs/app-server-protocol/schema/typescript/PlanType.ts +++ b/codex-rs/app-server-protocol/schema/typescript/PlanType.ts @@ -2,4 +2,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type PlanType = "free" | "go" | "plus" | "pro" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "unknown"; +export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "unknown"; diff --git a/codex-rs/backend-client/src/client.rs b/codex-rs/backend-client/src/client.rs index 6049c1697bf..20baa1cfead 100644 --- a/codex-rs/backend-client/src/client.rs +++ b/codex-rs/backend-client/src/client.rs @@ -473,6 +473,7 @@ impl Client { crate::types::PlanType::Go => AccountPlanType::Go, crate::types::PlanType::Plus => AccountPlanType::Plus, crate::types::PlanType::Pro => AccountPlanType::Pro, + crate::types::PlanType::ProLite => AccountPlanType::ProLite, crate::types::PlanType::Team => AccountPlanType::Team, crate::types::PlanType::SelfServeBusinessUsageBased => { AccountPlanType::SelfServeBusinessUsageBased @@ -486,7 +487,8 @@ impl Client { crate::types::PlanType::Guest | crate::types::PlanType::FreeWorkspace | crate::types::PlanType::Quorum - | crate::types::PlanType::K12 => AccountPlanType::Unknown, + | crate::types::PlanType::K12 + | crate::types::PlanType::Unknown => AccountPlanType::Unknown, } } diff --git a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs index 300674357a7..4d9ec1e364e 100644 --- a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs +++ b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs @@ -65,6 +65,8 @@ pub enum PlanType { Plus, #[serde(rename = "pro")] Pro, + #[serde(rename = "prolite")] + ProLite, #[serde(rename = "free_workspace")] FreeWorkspace, #[serde(rename = "team")] @@ -85,4 +87,6 @@ pub enum PlanType { Enterprise, #[serde(rename = "edu")] Edu, + #[serde(rename = "unknown", other)] + Unknown, } diff --git a/codex-rs/login/src/auth/manager.rs b/codex-rs/login/src/auth/manager.rs index 71857c9700a..15b129a1690 100644 --- a/codex-rs/login/src/auth/manager.rs +++ b/codex-rs/login/src/auth/manager.rs @@ -314,6 +314,7 @@ impl CodexAuth { InternalKnownPlan::Go => AccountPlanType::Go, InternalKnownPlan::Plus => AccountPlanType::Plus, InternalKnownPlan::Pro => AccountPlanType::Pro, + InternalKnownPlan::ProLite => AccountPlanType::ProLite, InternalKnownPlan::Team => AccountPlanType::Team, InternalKnownPlan::SelfServeBusinessUsageBased => { AccountPlanType::SelfServeBusinessUsageBased diff --git a/codex-rs/login/src/token_data_tests.rs b/codex-rs/login/src/token_data_tests.rs index be160ecd64a..aeb55ffb90f 100644 --- a/codex-rs/login/src/token_data_tests.rs +++ b/codex-rs/login/src/token_data_tests.rs @@ -153,4 +153,10 @@ fn workspace_account_detection_matches_workspace_plans() { ..IdTokenInfo::default() }; assert_eq!(personal.is_workspace_account(), false); + + let personal = IdTokenInfo { + chatgpt_plan_type: Some(PlanType::Known(KnownPlan::ProLite)), + ..IdTokenInfo::default() + }; + assert_eq!(personal.is_workspace_account(), false); } diff --git a/codex-rs/protocol/src/account.rs b/codex-rs/protocol/src/account.rs index e9f2fc9ec33..bb46329a51d 100644 --- a/codex-rs/protocol/src/account.rs +++ b/codex-rs/protocol/src/account.rs @@ -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::("\"self_serve_business_usage_based\"") .expect("self-serve business usage based should deserialize"), PlanType::SelfServeBusinessUsageBased ); + assert_eq!( + serde_json::from_str::("\"prolite\"").expect("prolite should deserialize"), + PlanType::ProLite + ); assert_eq!( serde_json::from_str::("\"enterprise_cbp_usage_based\"") .expect("enterprise cbp usage based should deserialize"), diff --git a/codex-rs/protocol/src/auth.rs b/codex-rs/protocol/src/auth.rs index 11455ec9094..99e067bf240 100644 --- a/codex-rs/protocol/src/auth.rs +++ b/codex-rs/protocol/src/auth.rs @@ -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", diff --git a/codex-rs/protocol/src/error.rs b/codex-rs/protocol/src/error.rs index 3ffdeb48e04..f421db8af5e 100644 --- a/codex-rs/protocol/src/error.rs +++ b/codex-rs/protocol/src/error.rs @@ -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()) ), diff --git a/codex-rs/tui/src/status/helpers.rs b/codex-rs/tui/src/status/helpers.rs index 338f50346bb..9abd96387c1 100644 --- a/codex-rs/tui/src/status/helpers.rs +++ b/codex-rs/tui/src/status/helpers.rs @@ -100,6 +100,8 @@ pub(crate) fn plan_type_display_name(plan_type: PlanType) -> String { "Business".to_string() } else if plan_type.is_business_like() { "Enterprise".to_string() + } else if plan_type == PlanType::ProLite { + "Pro Lite".to_string() } else { title_case(format!("{plan_type:?}").as_str()) } @@ -216,6 +218,7 @@ mod tests { (PlanType::Go, "Go"), (PlanType::Plus, "Plus"), (PlanType::Pro, "Pro"), + (PlanType::ProLite, "Pro Lite"), (PlanType::Team, "Business"), (PlanType::SelfServeBusinessUsageBased, "Business"), (PlanType::Business, "Enterprise"), diff --git a/codex-rs/tui/src/tooltips.rs b/codex-rs/tui/src/tooltips.rs index 9565831b27d..8f6d5ba1a5c 100644 --- a/codex-rs/tui/src/tooltips.rs +++ b/codex-rs/tui/src/tooltips.rs @@ -61,7 +61,7 @@ pub(crate) fn get_tooltip(plan: Option, fast_mode_enabled: bool) -> Op Some(plan_type) if matches!( plan_type, - PlanType::Plus | PlanType::Enterprise | PlanType::Pro + PlanType::Plus | PlanType::Enterprise | PlanType::Pro | PlanType::ProLite ) || plan_type.is_team_like() || plan_type.is_business_like() => {