fix(core): support OpenAI pro mode (#36896)
This commit is contained in:
parent
915be9b54d
commit
f4f761246a
5 changed files with 63 additions and 7 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue