Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Add Pro Max plan support and update Pro display names (#47971)

Eric Trautb725da3b6d52
diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json
index aedc6f44cf..27c71f2566 100644
--- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json
@@ -3327,6 +3327,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 9fc6373c67..c71e33e66a 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
@@ -16235,6 +16235,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 887dd47583..ff1a9ed1fc 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
@@ -12267,6 +12267,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 1f5c3ccabd..9eae3d95cc 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/AccountRateLimitsUpdatedNotification.json
@@ -29,6 +29,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 c4d6bc9e09..7ade554a7a 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/AccountUpdatedNotification.json
@@ -69,6 +69,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 b949ebc32d..785596cc04 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/GetAccountRateLimitsResponse.json
@@ -29,6 +29,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
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 4613d90f4f..e21145ee78 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/GetAccountResponse.json
@@ -84,6 +84,7 @@
"plus",
"pro",
"prolite",
+ "promax",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
diff --git a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst
index 07f3a62e3d..4d7b29652b 100644
Binary files a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst and b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst differ
diff --git a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst
index cdc852f453..003f33db9e 100644
Binary files a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst and b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst differ
diff --git a/codex-rs/app-server-protocol/schema/typescript/PlanType.ts b/codex-rs/app-server-protocol/schema/typescript/PlanType.ts
index 3f27f24052..b1fce3d953 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" | "prolite" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
+export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "promax" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
diff --git a/codex-rs/app-server/tests/suite/v2/account.rs b/codex-rs/app-server/tests/suite/v2/account.rs
index 590b2dc543..b2d9e51425 100644
--- a/codex-rs/app-server/tests/suite/v2/account.rs
+++ b/codex-rs/app-server/tests/suite/v2/account.rs
@@ -3279,6 +3279,7 @@ async fn get_account_with_chatgpt() -> Result<()> {
Ok(())
}
+#[test_case("promax", AccountPlanType::ProMax; "pro_max")]
#[test_case("self_serve_business_prolite", AccountPlanType::SelfServeBusinessProLite; "business_prolite")]
#[test_case("edu_plus", AccountPlanType::EduPlus; "edu_plus")]
#[test_case("edu_pro", AccountPlanType::EduPro; "edu_pro")]
diff --git a/codex-rs/app-server/tests/suite/v2/rate_limits.rs b/codex-rs/app-server/tests/suite/v2/rate_limits.rs
index ab29fe850f..8c53a4af9e 100644
--- a/codex-rs/app-server/tests/suite/v2/rate_limits.rs
+++ b/codex-rs/app-server/tests/suite/v2/rate_limits.rs
@@ -98,6 +98,7 @@ async fn get_account_rate_limits_requires_chatgpt_auth() -> Result<()> {
}
#[test_case("enterprise_cbp_automation", AccountPlanType::EnterpriseCbpAutomation; "enterprise_automation")]
+#[test_case("promax", AccountPlanType::ProMax; "pro_max")]
#[test_case("edu_plus", AccountPlanType::EduPlus; "edu_plus")]
#[test_case("edu_pro", AccountPlanType::EduPro; "edu_pro")]
#[tokio::test]
diff --git a/codex-rs/backend-client/src/client.rs b/codex-rs/backend-client/src/client.rs
index 48da6b0b66..54bf0ff48d 100644
--- a/codex-rs/backend-client/src/client.rs
+++ b/codex-rs/backend-client/src/client.rs
@@ -781,6 +781,7 @@ impl Client {
crate::types::PlanType::Plus => AccountPlanType::Plus,
crate::types::PlanType::Pro => AccountPlanType::Pro,
crate::types::PlanType::ProLite => AccountPlanType::ProLite,
+ crate::types::PlanType::ProMax => AccountPlanType::ProMax,
crate::types::PlanType::Team => AccountPlanType::Team,
crate::types::PlanType::SelfServeBusinessProLite => {
AccountPlanType::SelfServeBusinessProLite
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 81f89edbb8..6062257651 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
@@ -108,6 +108,8 @@ pub enum PlanType {
Pro,
#[serde(rename = "prolite")]
ProLite,
+ #[serde(rename = "promax")]
+ ProMax,
#[serde(rename = "free_workspace")]
FreeWorkspace,
#[serde(rename = "team")]
diff --git a/codex-rs/core/src/session/token_budget.rs b/codex-rs/core/src/session/token_budget.rs
index b56e21c43a..eebf9e1c8f 100644
--- a/codex-rs/core/src/session/token_budget.rs
+++ b/codex-rs/core/src/session/token_budget.rs
@@ -14,7 +14,7 @@ fn experimental_context_is_eligible(auth_mode: AuthMode, plan_type: Option<PlanT
auth_mode == AuthMode::Chatgpt
&& matches!(
plan_type,
- Some(PlanType::Plus | PlanType::Pro | PlanType::ProLite)
+ Some(PlanType::Plus | PlanType::Pro | PlanType::ProLite | PlanType::ProMax)
)
}
@@ -235,6 +235,7 @@ mod tests {
(AuthMode::Chatgpt, PlanType::Plus, true),
(AuthMode::Chatgpt, PlanType::Pro, true),
(AuthMode::Chatgpt, PlanType::ProLite, true),
+ (AuthMode::Chatgpt, PlanType::ProMax, true),
(AuthMode::Chatgpt, PlanType::Free, false),
(AuthMode::Chatgpt, PlanType::Enterprise, false),
(AuthMode::ApiKey, PlanType::Pro, false),
diff --git a/codex-rs/login/src/token_data_tests.rs b/codex-rs/login/src/token_data_tests.rs
index 8f4debcd9d..dc88aa648d 100644
--- a/codex-rs/login/src/token_data_tests.rs
+++ b/codex-rs/login/src/token_data_tests.rs
@@ -37,7 +37,7 @@ fn id_token_info_parses_email_and_plan() {
let info = parse_chatgpt_jwt_claims(&fake_jwt).expect("should parse");
assert_eq!(info.email.as_deref(), Some("[email protected]"));
- assert_eq!(info.get_chatgpt_plan_type().as_deref(), Some("Pro"));
+ assert_eq!(info.get_chatgpt_plan_type().as_deref(), Some("Pro (More)"));
}
#[test]
diff --git a/codex-rs/protocol/src/account.rs b/codex-rs/protocol/src/account.rs
index d9aa9ebf57..64705390ef 100644
--- a/codex-rs/protocol/src/account.rs
+++ b/codex-rs/protocol/src/account.rs
@@ -16,6 +16,7 @@ pub enum PlanType {
Plus,
Pro,
ProLite,
+ ProMax,
Team,
#[serde(rename = "self_serve_business_prolite")]
#[ts(rename = "self_serve_business_prolite")]
@@ -104,6 +105,7 @@ impl From<KnownPlan> for PlanType {
KnownPlan::Plus => Self::Plus,
KnownPlan::Pro => Self::Pro,
KnownPlan::ProLite => Self::ProLite,
+ KnownPlan::ProMax => Self::ProMax,
KnownPlan::Team => Self::Team,
KnownPlan::SelfServeBusinessProLite => Self::SelfServeBusinessProLite,
KnownPlan::SelfServeBusinessUsageBased => Self::SelfServeBusinessUsageBased,
diff --git a/codex-rs/protocol/src/auth.rs b/codex-rs/protocol/src/auth.rs
index 5f7debc617..38cfeb15db 100644
--- a/codex-rs/protocol/src/auth.rs
+++ b/codex-rs/protocol/src/auth.rs
@@ -78,6 +78,7 @@ impl PlanType {
"plus" => Self::Known(KnownPlan::Plus),
"pro" => Self::Known(KnownPlan::Pro),
"prolite" => Self::Known(KnownPlan::ProLite),
+ "promax" => Self::Known(KnownPlan::ProMax),
"team" => Self::Known(KnownPlan::Team),
"self_serve_business_prolite" => Self::Known(KnownPlan::SelfServeBusinessProLite),
"self_serve_business_usage_based" => {
@@ -104,6 +105,7 @@ pub enum KnownPlan {
Plus,
Pro,
ProLite,
+ ProMax,
Team,
#[serde(rename = "self_serve_business_prolite")]
SelfServeBusinessProLite,
@@ -131,8 +133,9 @@ impl KnownPlan {
Self::Free => "Free",
Self::Go => "Go",
Self::Plus => "Plus",
- Self::Pro => "Pro",
- Self::ProLite => "Pro Lite",
+ Self::Pro => "Pro (More)",
+ Self::ProLite => "Pro",
+ Self::ProMax => "Pro (Max)",
Self::Team => "Team",
Self::SelfServeBusinessProLite => "Self Serve Business ProLite",
Self::SelfServeBusinessUsageBased => "Self Serve Business Usage Based",
@@ -154,6 +157,7 @@ impl KnownPlan {
Self::Plus => "plus",
Self::Pro => "pro",
Self::ProLite => "prolite",
+ Self::ProMax => "promax",
Self::Team => "team",
Self::SelfServeBusinessProLite => "self_serve_business_prolite",
Self::SelfServeBusinessUsageBased => "self_serve_business_usage_based",
@@ -233,6 +237,7 @@ mod tests {
PlanType::Known(KnownPlan::EnterpriseCbpAutomation)
);
for (raw, known) in [
+ ("promax", KnownPlan::ProMax),
("edu_plus", KnownPlan::EduPlus),
("edu_pro", KnownPlan::EduPro),
] {
diff --git a/codex-rs/protocol/src/error.rs b/codex-rs/protocol/src/error.rs
index 9838a50a37..9cb401f29f 100644
--- a/codex-rs/protocol/src/error.rs
+++ b/codex-rs/protocol/src/error.rs
@@ -766,10 +766,12 @@ impl std::fmt::Display for UsageLimitReachedError {
retry_suffix_after_or(self.resets_at.as_ref())
)
}
- 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())
- ),
+ Some(PlanType::Known(KnownPlan::Pro | KnownPlan::ProLite | KnownPlan::ProMax)) => {
+ 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())
+ )
+ }
Some(PlanType::Known(
KnownPlan::Enterprise | KnownPlan::Edu | KnownPlan::EduPlus | KnownPlan::EduPro,
)) => format!(
diff --git a/codex-rs/tui/src/analytics/render.rs b/codex-rs/tui/src/analytics/render.rs
index 294fc638fb..5d3bb7cb1b 100644
--- a/codex-rs/tui/src/analytics/render.rs
+++ b/codex-rs/tui/src/analytics/render.rs
@@ -108,8 +108,9 @@ impl AnalyticsView {
PlanType::Free => "Free",
PlanType::Go => "Go",
PlanType::Plus => "Plus",
- PlanType::Pro => "Pro",
- PlanType::ProLite => "Pro Lite",
+ PlanType::Pro => "Pro (More)",
+ PlanType::ProLite => "Pro",
+ PlanType::ProMax => "Pro (Max)",
PlanType::Team
| PlanType::Business
| PlanType::SelfServeBusinessProLite
diff --git a/codex-rs/tui/src/analytics/summary_panel.rs b/codex-rs/tui/src/analytics/summary_panel.rs
index 121d383e87..a8d25f7571 100644
--- a/codex-rs/tui/src/analytics/summary_panel.rs
+++ b/codex-rs/tui/src/analytics/summary_panel.rs
@@ -62,8 +62,9 @@ impl AnalyticsView {
PlanType::Free => "Free",
PlanType::Go => "Go",
PlanType::Plus => "Plus",
- PlanType::Pro => "Pro",
- PlanType::ProLite => "Pro Lite",
+ PlanType::Pro => "Pro (More)",
+ PlanType::ProLite => "Pro",
+ PlanType::ProMax => "Pro (Max)",
PlanType::Team
| PlanType::Business
| PlanType::SelfServeBusinessProLite
diff --git a/codex-rs/tui/src/status/helpers.rs b/codex-rs/tui/src/status/helpers.rs
index 48023dc962..0bdd688d84 100644
--- a/codex-rs/tui/src/status/helpers.rs
+++ b/codex-rs/tui/src/status/helpers.rs
@@ -106,8 +106,12 @@ 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::Pro {
+ "Pro (More)".to_string()
+ } else if plan_type == PlanType::ProMax {
+ "Pro (Max)".to_string()
} else if plan_type == PlanType::ProLite {
- "Pro Lite".to_string()
+ "Pro".to_string()
} else if plan_type == PlanType::EduPlus {
"Edu Plus".to_string()
} else if plan_type == PlanType::EduPro {
@@ -229,8 +233,9 @@ mod tests {
(PlanType::Free, "Free"),
(PlanType::Go, "Go"),
(PlanType::Plus, "Plus"),
- (PlanType::Pro, "Pro"),
- (PlanType::ProLite, "Pro Lite"),
+ (PlanType::Pro, "Pro (More)"),
+ (PlanType::ProLite, "Pro"),
+ (PlanType::ProMax, "Pro (Max)"),
(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 fddd6d9b12..7dff716092 100644
--- a/codex-rs/tui/src/tooltips.rs
+++ b/codex-rs/tui/src/tooltips.rs
@@ -94,7 +94,11 @@ pub(crate) fn preferred_tooltip<R: Rng + ?Sized>(
Some(plan_type)
if matches!(
plan_type,
- PlanType::Plus | PlanType::Enterprise | PlanType::Pro | PlanType::ProLite
+ PlanType::Plus
+ | PlanType::Enterprise
+ | PlanType::Pro
+ | PlanType::ProLite
+ | PlanType::ProMax
) || plan_type.is_team_like()
|| plan_type.is_business_like() =>
{
diff --git a/sdk/python/src/openai_codex/generated/v2_all.py b/sdk/python/src/openai_codex/generated/v2_all.py
index 4dd9a70968..4685b97762 100644
--- a/sdk/python/src/openai_codex/generated/v2_all.py
+++ b/sdk/python/src/openai_codex/generated/v2_all.py
@@ -3096,6 +3096,7 @@ class PlanType(str, Enum):
plus = "plus"
pro = "pro"
prolite = "prolite"
+ promax = "promax"
team = "team"
self_serve_business_prolite = "self_serve_business_prolite"
self_serve_business_usage_based = "self_serve_business_usage_based"