2. Let $a<-1$, and the variable $x$ satisfies $x^{2}+a x \leqslant-x$, and the minimum value of $x^{2}+a x$ is $-\frac{1}{2}$. Then $a=$ $\qquad$ .
2. $-\frac{3}{2}$.

Given $a-(a+1)$, i.e., $-2<a<-1$, then $f(x)$ reaches its minimum value at $x=-(a+1)$, which is $f(-a-1)=a+1$.
Therefore, $a+1=-\frac{1}{2}$, which means $a=-\frac{3}{2}$.
If $-\frac{a}{2} \leqslant -(a+1)$, i.e., $a \leqslant -2$, then $f(x)$ reaches its minimum value at $x=-\frac{a}{2}$, which is $-\frac{a^{2}}{4}$.
Therefore, $-\frac{a^{2}}{4}=-\frac{1}{2}$.
Solving this, we get $a= \pm \sqrt{2}$ (discard).
In summary, $a=-\frac{3}{2}$.