Normally I would think this kind of question doesn't belong on overflow, but I haven't been able to find an answer anywhere else, so perhaps it is not so trivial.
Let $f: X \rightarrow Y$ be a morphism of schemes, where $Y = \text{spec}A$ is affine. Let $\mathcal{L}$ be an invertible sheaf on $X$, globally generated by sections. Is it true that the direct image functor $f_{*}$ respects arbitrary direct sums in the sense that, $$ f_{*} \bigoplus_{d \geq 0} \mathcal{L}^{\otimes d} \simeq \bigoplus_{d \geq 0} f_{*} \mathcal{L}^{\otimes d} $$
If it is true, how would one prove it? If not, what extra conditions are needed on $f$ that would make this true?
I ask because it seems to be what's happening in the stacks project here. I have asked the question in a comment there as well. If $f$ was quasicompact and quasiseparated I can see it being true, but that is not assumed there. Initially I thought it was a mistake, but it seems to be used repeatedly in the following results on the stacks project.