@@ -105,7 +105,7 @@ struct ProviderSubscriptionPresets {
105105 static let codex : [ SubscriptionPreset ] = [
106106 SubscriptionPreset ( name: " Go " , cost: 8 ) ,
107107 SubscriptionPreset ( name: " Plus " , cost: 20 ) ,
108- SubscriptionPreset ( name: " Team " , cost: 30 ) ,
108+ SubscriptionPreset ( name: " Business " , cost: 25 ) ,
109109 SubscriptionPreset ( name: " Pro " , cost: 200 )
110110 ]
111111
@@ -228,7 +228,12 @@ final class SubscriptionSettingsManager {
228228 let plan = try ? JSONDecoder ( ) . decode ( SubscriptionPlan . self, from: data) else {
229229 return . none
230230 }
231- return plan
231+ let normalizedPlan = normalizeLegacyPlan ( plan, forKey: key)
232+ if normalizedPlan != plan {
233+ NSLog ( " Migrated legacy ChatGPT Team subscription preset to Business for key '%@' " , fullKey)
234+ setPlan ( normalizedPlan, forKey: key)
235+ }
236+ return normalizedPlan
232237 }
233238
234239 func getPlan( for provider: ProviderIdentifier , accountId: String ? = nil ) -> SubscriptionPlan {
@@ -284,4 +289,19 @@ final class SubscriptionSettingsManager {
284289 }
285290 return false
286291 }
292+
293+ private func normalizeLegacyPlan( _ plan: SubscriptionPlan , forKey key: String ) -> SubscriptionPlan {
294+ let isCodexSubscription = key == ProviderIdentifier . codex. rawValue
295+ || key. hasPrefix ( " \( ProviderIdentifier . codex. rawValue) . " )
296+ guard isCodexSubscription else {
297+ return plan
298+ }
299+
300+ guard case . preset( let name, _) = plan,
301+ name. caseInsensitiveCompare ( " Team " ) == . orderedSame else {
302+ return plan
303+ }
304+
305+ return . preset( " Business " , 25 )
306+ }
287307}
0 commit comments