high95%
ModelRetryMiddleware/ToolRetryMiddleware `retry_on=SomeError` retries every exception
In langchain's retry middleware, `should_retry_exception` checks `callable(retry_on)` before `isinstance`, treating exception classes as callables. Passing a single exception class (e.g. `TimeoutError`) invokes the class with the exception, returning a truthy exception instance, causing every exception to be retried regardless of the intended filter.
