fix(core): support OpenAI pro mode (#36896)

This commit is contained in:
Aiden Cline 2026-07-14 15:12:51 -05:00 committed by GitHub
commit f4f761246a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 63 additions and 7 deletions

View file

@ -31,7 +31,7 @@ export const accountID = (credential: CredentialLike | undefined) => {
}
const allowed = new Set(["gpt-5.5", "gpt-5.3-codex-spark", "gpt-5.4", "gpt-5.4-mini"])
const disallowed = new Set(["gpt-5.5-pro"])
const disallowed = new Set(["gpt-5.5-pro", "gpt-5.6"])
/** Which API model ids a ChatGPT subscription may call through the codex backend. */
export const eligible = (apiID: string) => {

View file

@ -194,6 +194,10 @@ export const OpenAIPlugin = define({
// ChatGPT-plan tokens only authorize codex-eligible models, and the
// subscription covers usage, so hide the rest and zero the cost.
evt.model.update(item.provider.id, model.id, (draft) => {
if (Schema.is(Schema.Struct({ mode: Schema.Literal("pro") }))(draft.body?.reasoning)) {
draft.enabled = false
return
}
if (!OpenAICodex.eligible(draft.modelID ?? draft.id)) {
draft.enabled = false
return