fix: auto toolset detect chatgpt_oauth as codex (#1033)

This commit is contained in:
Charles Packer
2026-02-19 00:28:32 -08:00
committed by GitHub
parent aed7e5d119
commit 093657b63c
2 changed files with 15 additions and 2 deletions

View File

@@ -898,14 +898,16 @@ export function isOpenAIModel(modelIdentifier: string): boolean {
if (info?.handle && typeof info.handle === "string") {
return (
info.handle.startsWith("openai/") ||
info.handle.startsWith(`${OPENAI_CODEX_PROVIDER_NAME}/`)
info.handle.startsWith(`${OPENAI_CODEX_PROVIDER_NAME}/`) ||
info.handle.startsWith("chatgpt_oauth/")
);
}
// Fallback: treat raw handle-style identifiers as OpenAI for openai/*
// and ChatGPT OAuth Codex provider handles.
return (
modelIdentifier.startsWith("openai/") ||
modelIdentifier.startsWith(`${OPENAI_CODEX_PROVIDER_NAME}/`)
modelIdentifier.startsWith(`${OPENAI_CODEX_PROVIDER_NAME}/`) ||
modelIdentifier.startsWith("chatgpt_oauth/")
);
}