@@ -117,12 +117,17 @@ function reasoningEffortLabel(reasoningEffort: string): string {
117117 return REASONING_EFFORT_LABELS [ reasoningEffort ] ?? reasoningEffort ;
118118}
119119
120- function codexAccountAuthLabel ( account : CodexSchema . V2GetAccountResponse [ "account" ] ) {
120+ function codexAccountAuthLabel (
121+ account : CodexSchema . V2GetAccountResponse [ "account" ] ,
122+ usagePlanType : string | null | undefined ,
123+ ) {
121124 if ( ! account ) return undefined ;
122125 if ( account . type === "apiKey" ) return "OpenAI API Key" ;
123126 if ( account . type === "amazonBedrock" ) return "Amazon Bedrock" ;
124127 if ( account . type !== "chatgpt" ) return undefined ;
125- return codexPlanLabel ( account . planType ) ;
128+ // account/read takes the plan from the cached login token; the usage read asks the backend.
129+ const usageLabel = usagePlanType === "unknown" ? undefined : codexPlanLabel ( usagePlanType ) ;
130+ return usageLabel ?? codexPlanLabel ( account . planType ) ;
126131}
127132
128133export function codexPlanLabel ( planType : string | null | undefined ) : string | undefined {
@@ -698,7 +703,10 @@ function accountProbeStatus({ account, rateLimits }: CodexAppServerProviderSnaps
698703 readonly auth : ServerProvider [ "auth" ] ;
699704 readonly message ?: string ;
700705} {
701- const authLabel = codexAccountAuthLabel ( account . account ) ;
706+ const authLabel = codexAccountAuthLabel (
707+ account . account ,
708+ rateLimits && "snapshot" in rateLimits ? rateLimits . snapshot . planType : undefined ,
709+ ) ;
702710 const authEmail = codexAccountEmail ( account . account ) ;
703711 const workspaceId =
704712 rateLimits && "accountId" in rateLimits ? rateLimits . accountId ?. trim ( ) : undefined ;
0 commit comments