fix(router): keep cooldown_time off the shared no-deployment base error

Declaring cooldown_time as float | None on the base widened the attribute on
RouterRateLimitError, whose callers compare it as a float, and redeclaring it as
float on the subclass is an incompatible override. The base now carries only
status_code; RouterRateLimitError keeps its own float cooldown_time exactly as before

Co-authored-by: songkuan-zheng <252822057+songkuan-zheng@users.noreply.github.com>
Co-authored-by: songkuan-zheng <songkuan-zheng@users.noreply.github.com>
This commit is contained in:
songkuan-zheng 2026-09-11 12:29:43 +00:00
parent 05abb93c5d
commit 8f3a7b54c7

View file

@ -944,7 +944,6 @@ class RouterGeneralSettings(BaseModel):
class RouterNoDeploymentsAvailableError(ValueError):
status_code: int = 429
cooldown_time: float | None = None
class RouterRateLimitErrorBasic(RouterNoDeploymentsAvailableError):
@ -967,8 +966,6 @@ class RouterErrorTypes(str, enum.Enum):
class RouterRateLimitError(RouterNoDeploymentsAvailableError):
cooldown_time: float
def __init__(
self,
model: str,