Let $f(x)$ be a function such that for all $T \leq f(x), \ T / x \to \infty$ we have $$ \sum_{x \leq n < 2 x} e^{2 \pi i T / n} = o(x). $$ How fast can $f(x)$ grow?

I can show that for any $\varepsilon > 0$, $f(x) = e^{(\log x)^{2 - \varepsilon}}$ works, and that any such function $f$ must satisfy $f(x) \leq e^{x^{\varepsilon}}$ for large enough $x$, and I am interested in an improvement of either of these bounds.

For the lower bound, I tried the two standard methods I know of to deal with exponential sums which are Poisson summation and Weyl differencing. Poisson summation seemed to lead nowhere, as this sum is very rapidly oscillating.

Weyl differencing leads to the lower bound I've written. The problem with iterated Weyl differencing is that applying it more than $\log x$ times is useless, because even if each sum (after the iterated Weyl differencing) was bounded by $\mathcal{O}(1)$, we still could not get a nontrivial bound. This happens because applying the triangle inequality many times "loses" cancellation.

As for the upper bound, taking $T = \operatorname{lcm} (1, \dotsc, 2 x)$ leads to an upper bound of $e^{2 x}$, and this can be improved by taking $T = k \cdot \operatorname{lcm} (1, \dotsc, x^{\varepsilon} )$, where $\varepsilon > 0$ is fixed and $k$ is a small random number. The trick here is that the probability that a natural number of size at most $x$ is $x^{\varepsilon}$-smooth (has all prime factors at most $x^\varepsilon$) is a positive constant. Thus, running over (say) $k \leq x^2$ and taking the expected value of the sum, we see that on average it is a positive constant times $x$, and thus for some $k$ the sum has absolute value at least a constant times $x$.