8 The function $f(x)=\left\{\begin{array}{ll}\sin \left(\pi x^{2}\right) & (-1<x<0), \\ \mathrm{e}^{x-1} & (x \geqslant 0)\end{array}\right.$ satisfies $f(1)+f(a)=2$, then the possible values of $a$ are ( ).
(A) 1 or $-\frac{\sqrt{2}}{2}$
(B) $-\frac{\sqrt{2}}{2}$
(C) 1
(D) 1 or $\frac{\sqrt{2}}{2}$
$8 \mathrm{~A}$