fix: gpt-5 name-based config clearing from base chat path (#13949)

### What problem does this PR solve?

fix #13944 where OpenAI-compatible custom endpoints failed verification
when model names contained `gpt-5` becauser of incorrect name-based
handling in the Base/backend=`base` path.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Idriss Sbaaoui
2026-04-07 11:24:47 +08:00
committed by GitHub
parent a0be7c7ca7
commit ff27ce86d6

View File

@@ -77,9 +77,6 @@ def _apply_model_family_policies(
sanitized_kwargs["extra_body"] = {"enable_thinking": False}
if backend == "base":
# GPT-5 and GPT-5.1 endpoints in this path have inconsistent generation-param support.
if "gpt-5" in model_name_lower:
sanitized_gen_conf = {}
return sanitized_gen_conf, sanitized_kwargs
if backend == "litellm":
@@ -151,14 +148,11 @@ class Base(ABC):
return LLMErrorCode.ERROR_GENERIC
def _clean_conf(self, gen_conf):
model_name_lower = (self.model_name or "").lower()
gen_conf, _ = _apply_model_family_policies(
self.model_name,
backend="base",
gen_conf=gen_conf,
)
if "gpt-5" in model_name_lower:
return gen_conf
if "max_tokens" in gen_conf:
del gen_conf["max_tokens"]