mirror of
https://github.com/openai/codex.git
synced 2026-10-27 18:48:37 +00:00
## What changed - Recognize `sci` and `sci_plus` in authentication, account responses, rate limits, and generated client schemas. - Treat both plans as workspace accounts eligible for cloud configuration, and use business analytics routes. - Display “Academic Researchers” and “Academic Researchers Plus” in the TUI and direct users to their admin when usage limits are reached. ## Testing Add coverage for plan parsing, workspace classification, account and rate-limit responses, cloud configuration eligibility, analytics routing, TUI labels, and usage-limit guidance. Exercise installed-app refresh and listing with `sci_plus` authentication. GitOrigin-RevId: b51c5df03029b8bc249d44f11b353a7755e7dd04
42 lines
1.8 KiB
Rust
42 lines
1.8 KiB
Rust
//! Subscription labels for TUI surfaces, preserving status-specific plan detail.
|
|
|
|
use codex_protocol::account::PlanType;
|
|
use codex_protocol::auth::KnownPlan;
|
|
|
|
pub(crate) enum SubscriptionDisplay {
|
|
Status,
|
|
Analytics,
|
|
}
|
|
|
|
impl SubscriptionDisplay {
|
|
pub(crate) fn label(&self, plan: PlanType) -> &'static str {
|
|
match (plan, self) {
|
|
(PlanType::Free, _) => "Free",
|
|
(PlanType::Go, _) => "Go",
|
|
(PlanType::Plus, _) => "Plus",
|
|
(PlanType::Pro, _) => "Pro 200",
|
|
(PlanType::ProLite, _) => "Pro 100",
|
|
(PlanType::ProMax, _) => "Pro 500",
|
|
(PlanType::Team | PlanType::SelfServeBusinessUsageBased, _) => "Business",
|
|
(PlanType::Business, Self::Status) => "Enterprise",
|
|
(PlanType::SelfServeBusinessProLite, Self::Status) => "Business Premium",
|
|
(PlanType::Business | PlanType::SelfServeBusinessProLite, Self::Analytics) => {
|
|
"Business"
|
|
}
|
|
(PlanType::EnterpriseCbpAutomation, Self::Status) => "Enterprise (Automation)",
|
|
(PlanType::EnterpriseCbpAutomation, Self::Analytics)
|
|
| (PlanType::Enterprise | PlanType::Ent26 | PlanType::EnterpriseCbpUsageBased, _) => {
|
|
"Enterprise"
|
|
}
|
|
(PlanType::Edu, Self::Status) => "Edu",
|
|
(PlanType::EduPlus, Self::Status) => "Edu Plus",
|
|
(PlanType::EduPro, Self::Status) => "Edu Pro",
|
|
(PlanType::Edu | PlanType::EduPlus | PlanType::EduPro, Self::Analytics) => "Education",
|
|
(PlanType::Sci, _) => KnownPlan::Sci.display_name(),
|
|
(PlanType::SciPlus, _) => KnownPlan::SciPlus.display_name(),
|
|
(PlanType::Unknown, Self::Status) => "Unknown",
|
|
(PlanType::Unknown, Self::Analytics) => "Account",
|
|
}
|
|
}
|
|
}
|