You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Across the codebase, audit every ``except ValidationError`` site and:
* For specific ``Foo.model_validate(...)`` call sites where ``Foo`` is a
``BackendAIModel`` subclass, swap to ``except BackendAIModelValidationFailed``.
The auto-conversion override means raw ``ValidationError`` no longer
reaches these sites.
* For generalized middleware / decorator entry points (``pydantic_params_api_handler``,
``extract_param_value``, ``convert_validation_error``,
``PydanticJWTValidator.validate``, the appproxy coordinator's
``exception_middleware``), keep BOTH ``BackendAIModelValidationFailed``
AND ``ValidationError`` branches with a comment explaining the
``ValidationError`` arm is a defensive fallback for plain
``BaseModel`` subclasses that bypass the auto-conversion override.
* For constructor calls (``Model(**data)``) and ``TypeAdapter.validate_python(...)``,
leave ``ValidationError`` untouched — the override is opt-in on the
``model_validate`` classmethods only.
No public response shapes change; the swap is purely about which type
the right branch catches now that all project Pydantic models inherit
``BackendAIModel``.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments