fix(core): tighten ChatGPT codex model eligibility
Replace the codex-substring heuristic with the empirically verified allow/disallow lists plus the >5.4 version rule; the ChatGPT backend rejects models like gpt-5.3-codex that the substring rule admitted.
This commit is contained in:
parent
781165c884
commit
f019bb3abf
2 changed files with 16 additions and 7 deletions
|
|
@ -181,7 +181,7 @@ export const OpenAIPlugin = define({
|
|||
if (!chatgpt) continue
|
||||
for (const model of item.models.values()) {
|
||||
evt.model.update(item.provider.id, model.id, (draft) => {
|
||||
if (!eligible(draft)) {
|
||||
if (!eligible(draft.api.id)) {
|
||||
draft.enabled = false
|
||||
return
|
||||
}
|
||||
|
|
@ -316,8 +316,15 @@ function isChatGPT(credential: { readonly type: string; readonly methodID?: stri
|
|||
)
|
||||
}
|
||||
|
||||
function eligible(model: { readonly id: string }) {
|
||||
return model.id.includes("codex")
|
||||
const chatgptAllowed = new Set(["gpt-5.5", "gpt-5.3-codex-spark", "gpt-5.4", "gpt-5.4-mini"])
|
||||
const chatgptDisallowed = new Set(["gpt-5.5-pro"])
|
||||
|
||||
/** Which API model ids a ChatGPT subscription may call through the codex backend. */
|
||||
function eligible(apiID: string) {
|
||||
if (chatgptAllowed.has(apiID)) return true
|
||||
if (chatgptDisallowed.has(apiID)) return false
|
||||
const match = apiID.match(/^gpt-(\d+\.\d+)/)
|
||||
return match ? Number.parseFloat(match[1]) > 5.4 : false
|
||||
}
|
||||
|
||||
function claim(token: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue