Lightweight coding agent that runs in your terminal
Rust
Support prolite plan type (#17419)
Eric Traut3b948d9dd8d2
diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.jsonindex 5d7c1549ab..c3ab83766a 100644--- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json+++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json@@ -2010,6 +2010,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.jsonindex 2c575202e8..dd839cd586 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@@ -9924,6 +9924,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.jsonindex 56497c786f..66b91082e0 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@@ -6720,6 +6720,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.jsonindex d1812f069f..67a5f055b3 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.jsonindex f2cf7cb3ab..64109ca2a0 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.jsonindex 23f7d3cfdc..2d34ee47d1 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.jsonindex acaa779184..8534927157 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.tsindex ad5bcab380..44891467e9 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.rsindex 6049c1697b..20baa1cfea 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.rsindex 300674357a..4d9ec1e364 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.rsindex 71857c9700..15b129a169 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::SelfServeBusinessUsageBaseddiff --git a/codex-rs/login/src/token_data_tests.rs b/codex-rs/login/src/token_data_tests.rsindex be160ecd64..aeb55ffb90 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.rsindex e9f2fc9ec3..bb46329a51 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::<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"),diff --git a/codex-rs/protocol/src/auth.rs b/codex-rs/protocol/src/auth.rsindex 11455ec909..99e067bf24 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.rsindex 3ffdeb48e0..f421db8af5 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.rsindex 5103b9e4d3..ef28ed7fcf 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.rsindex 9565831b27..8f6d5ba1a5 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<PlanType>, fast_mode_enabled: bool) -> OpSome(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() =>{