remove use of threadLocalSession in type-provider related code