diff --git a/tools/cronjob_tools.py b/tools/cronjob_tools.py index d0ef994ae..ec4b41b3c 100644 --- a/tools/cronjob_tools.py +++ b/tools/cronjob_tools.py @@ -128,6 +128,15 @@ def _resolve_model_override(model_obj: Optional[Dict[str, Any]]) -> tuple: return (None, None) model_name = (model_obj.get("model") or "").strip() or None provider_name = (model_obj.get("provider") or "").strip() or None + # Bare "custom" is an incomplete spec — the canonical form is + # "custom:" matching a custom_providers entry. LLMs frequently + # supply the bare type because the schema does not advertise the + # ":" suffix, which used to bypass the pinning path below and + # leave the job stored with an unresolvable "custom" provider. Treat + # the bare value as "no provider supplied" so the current main + # provider gets pinned instead. + if provider_name == "custom": + provider_name = None if model_name and not provider_name: # Pin to the current main provider so the job is stable try: