BSP clients (Metals) can trigger many compilations in a row. But sbt does not cache failed compilation, so it restarts the compilation many times which is super slow. To improve this we can use Zinc or the ActionCache to cache compilation failures.
Also we can generalize this to all cachedTask, or make it configurable. But only some known and serializable types of exception should be cached.