high95%
BaseChatModel.agenerate masks non-Exception BaseException with AttributeError
When a callback is attached and a BaseException (not Exception) like asyncio.CancelledError or KeyboardInterrupt is raised inside _agenerate, the cleanup code attempts to access .generations on the exception object, masking the original error with AttributeError.
